Remove position atribute on Player
This commit is contained in:
parent
498a449a91
commit
1090d358c2
@ -7,16 +7,14 @@ import fr.lnl.game.server.utils.Point;
|
|||||||
public abstract class AbstractPlayer implements Player {
|
public abstract class AbstractPlayer implements Player {
|
||||||
|
|
||||||
private int id;
|
private int id;
|
||||||
private Point position;
|
|
||||||
private int energy;
|
private int energy;
|
||||||
private Weapon weapon;
|
private Weapon weapon;
|
||||||
private boolean shieldDeploy;
|
private boolean shieldDeploy;
|
||||||
private Action[] actions;
|
private Action[] actions;
|
||||||
private ClassPlayer classPlayer;
|
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.id = id;
|
||||||
this.position = position;
|
|
||||||
this.classPlayer = classPlayer;
|
this.classPlayer = classPlayer;
|
||||||
this.energy = classPlayer.getEnergy();
|
this.energy = classPlayer.getEnergy();
|
||||||
this.weapon = classPlayer.getWeapon();
|
this.weapon = classPlayer.getWeapon();
|
||||||
@ -31,10 +29,6 @@ public abstract class AbstractPlayer implements Player {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Point getPosition() {
|
|
||||||
return position;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getEnergy() {
|
public int getEnergy() {
|
||||||
return energy;
|
return energy;
|
||||||
}
|
}
|
||||||
@ -51,10 +45,6 @@ public abstract class AbstractPlayer implements Player {
|
|||||||
this.energy = energy;
|
this.energy = energy;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPosition(Point position) {
|
|
||||||
this.position = position;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setShieldDeploy(boolean shieldDeploy) {
|
public void setShieldDeploy(boolean shieldDeploy) {
|
||||||
this.shieldDeploy = shieldDeploy;
|
this.shieldDeploy = shieldDeploy;
|
||||||
}
|
}
|
||||||
|
@ -4,11 +4,11 @@ import fr.lnl.game.server.utils.Point;
|
|||||||
|
|
||||||
public class ComputerPlayer extends AbstractPlayer{
|
public class ComputerPlayer extends AbstractPlayer{
|
||||||
|
|
||||||
public ComputerPlayer(int id, Point position, boolean shieldDeploy, ClassPlayer classPlayer) {
|
public ComputerPlayer(int id, boolean shieldDeploy, ClassPlayer classPlayer) {
|
||||||
super(id, position, shieldDeploy, classPlayer);
|
super(id, shieldDeploy, classPlayer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ComputerPlayer(int id, ClassPlayer classPlayer) {
|
public ComputerPlayer(int id, ClassPlayer classPlayer) {
|
||||||
super(id, null,false, classPlayer);
|
super(id,false, classPlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
package fr.lnl.game.server.games.player;
|
package fr.lnl.game.server.games.player;
|
||||||
|
|
||||||
import fr.lnl.game.server.games.weapon.Weapon;
|
|
||||||
import fr.lnl.game.server.utils.Point;
|
import fr.lnl.game.server.utils.Point;
|
||||||
|
|
||||||
public class HumanPlayer extends AbstractPlayer {
|
public class HumanPlayer extends AbstractPlayer {
|
||||||
|
|
||||||
public HumanPlayer(int id, Point position, boolean shieldDeploy, ClassPlayer classPlayer) {
|
public HumanPlayer(int id, boolean shieldDeploy, ClassPlayer classPlayer) {
|
||||||
super(id, position, shieldDeploy, classPlayer);
|
super(id, shieldDeploy, classPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
public HumanPlayer(int id, ClassPlayer classPlayer) {
|
||||||
|
super(id, false, classPlayer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user