Remove position atribute on Player

This commit is contained in:
Katchan 2021-10-20 14:52:04 +02:00
parent 498a449a91
commit 1090d358c2
3 changed files with 10 additions and 17 deletions

View File

@ -7,16 +7,14 @@ import fr.lnl.game.server.utils.Point;
public abstract class AbstractPlayer implements Player {
private int id;
private Point position;
private int energy;
private Weapon weapon;
private boolean shieldDeploy;
private Action[] actions;
private ClassPlayer classPlayer;
public AbstractPlayer(int id, Point position, boolean shieldDeploy, ClassPlayer classPlayer) {
public AbstractPlayer(int id, boolean shieldDeploy, ClassPlayer classPlayer) {
this.id = id;
this.position = position;
this.classPlayer = classPlayer;
this.energy = classPlayer.getEnergy();
this.weapon = classPlayer.getWeapon();
@ -31,10 +29,6 @@ public abstract class AbstractPlayer implements Player {
return id;
}
public Point getPosition() {
return position;
}
public int getEnergy() {
return energy;
}
@ -51,10 +45,6 @@ public abstract class AbstractPlayer implements Player {
this.energy = energy;
}
public void setPosition(Point position) {
this.position = position;
}
public void setShieldDeploy(boolean shieldDeploy) {
this.shieldDeploy = shieldDeploy;
}

View File

@ -4,11 +4,11 @@ import fr.lnl.game.server.utils.Point;
public class ComputerPlayer extends AbstractPlayer{
public ComputerPlayer(int id, Point position, boolean shieldDeploy, ClassPlayer classPlayer) {
super(id, position, shieldDeploy, classPlayer);
public ComputerPlayer(int id, boolean shieldDeploy, ClassPlayer classPlayer) {
super(id, shieldDeploy, classPlayer);
}
public ComputerPlayer(int id, ClassPlayer classPlayer) {
super(id, null,false, classPlayer);
super(id,false, classPlayer);
}
}

View File

@ -1,11 +1,14 @@
package fr.lnl.game.server.games.player;
import fr.lnl.game.server.games.weapon.Weapon;
import fr.lnl.game.server.utils.Point;
public class HumanPlayer extends AbstractPlayer {
public HumanPlayer(int id, Point position, boolean shieldDeploy, ClassPlayer classPlayer) {
super(id, position, shieldDeploy, classPlayer);
public HumanPlayer(int id, boolean shieldDeploy, ClassPlayer classPlayer) {
super(id, shieldDeploy, classPlayer);
}
public HumanPlayer(int id, ClassPlayer classPlayer) {
super(id, false, classPlayer);
}
}