Created
July 29, 2023 10:00
-
-
Save Raf0707/8742bd63cc0e5718543ce8ecc856141b to your computer and use it in GitHub Desktop.
Player
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pize.graphics.entities; | |
public class Player implements Person { | |
public String name; | |
public String nick; | |
public int minDamage; | |
public int maxDamage; | |
public int damage; | |
public int hp; | |
public Player(String name, String nick, int minDamage, int maxDamage, int hp, int damage) { | |
this.name = name; | |
this.nick = nick; | |
this.minDamage = minDamage; | |
this.maxDamage = maxDamage; | |
this.hp = hp; | |
} | |
public int getDamage() { | |
return damage; | |
} | |
public void setDamage(int damage) { | |
this.damage = damage; | |
} | |
public String getName() { | |
return name; | |
} | |
public void setName(String name) { | |
this.name = name; | |
} | |
public String getNick() { | |
return nick; | |
} | |
public void setNick(String nick) { | |
this.nick = nick; | |
} | |
public int getMinDamage() { | |
return minDamage; | |
} | |
public void setMinDamage(int minDamage) { | |
this.minDamage = minDamage; | |
} | |
public int getMaxDamage() { | |
return maxDamage; | |
} | |
public void setMaxDamage(int maxDamage) { | |
this.maxDamage = maxDamage; | |
} | |
public int getHp() { | |
return hp; | |
} | |
public void setHp(int hp) { | |
this.hp = hp; | |
} | |
@Override | |
public void strike(Player me, Player player2) { | |
player2.setHp(player2.getHp() - me.getDamage()); | |
} | |
@Override | |
public void die(Player player) { | |
player.setHp(0); | |
} | |
@Override | |
public void takeDamage(Player me, Player player2) { | |
me.setHp(me.getHp() - player2.getDamage()); | |
} | |
@Override | |
public void eat(Player player, int calloryEat) { | |
player.setHp(calloryEat); | |
} | |
@Override | |
public void changeName(Player player, String name) { | |
player.setName(name); | |
} | |
@Override | |
public void changeNick(Player player, String nich) { | |
player.setNick(nick); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment