JHandHero - Game.java
Cerca
 











Game.java

Caricato da: Paoloricciuti
Scarica il programma completo

  1. package jhandhero;
  2.  
  3. public class Game {
  4.  
  5.     private Player player;
  6.     private int level;
  7.  
  8.     public Game() {
  9.         this(new Player(), 1);
  10.     }
  11.  
  12.     public Game(int pLevel) {
  13.         this(new Player(), pLevel);
  14.     }
  15.  
  16.     public Game(Player pPlayer) {
  17.         this(pPlayer, 1);
  18.     }
  19.  
  20.     public Game(Player pPlayer, int pLevel) {
  21.         this.player = pPlayer;
  22.         this.level = pLevel;
  23.     }
  24.  
  25.     public int getLevel() {
  26.         return this.level;
  27.     }
  28.  
  29.     public void setLevel(int pLevel) {
  30.         this.level = pLevel;
  31.     }
  32.  
  33.     public Player getPlayer() {
  34.         return this.player;
  35.     }
  36.  
  37.     public void setPlayer(Player pPlayer) {
  38.         this.player = pPlayer;
  39.     }
  40.  
  41.     public void upLevel(){
  42.         if(this.level<10){
  43.             this.level++;
  44.         }
  45.     }
  46. }
 

Creative Commons License
Il layout di questo sito è concesso sotto licenza Creative Commons.
Per maggiori informazioni sulle licenze dei contenuti del sito, clicca.