Edit ComputerPlayer abd Firearm constructor

This commit is contained in:
Katchan 2021-10-18 18:19:16 +02:00
parent e04b70d8e6
commit e81fb4af2e
3 changed files with 20 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package fr.lnl.game.server.games.player;
import fr.lnl.game.server.games.action.Action;
import fr.lnl.game.server.games.weapon.Weapon;
import fr.lnl.game.server.utils.Point;
@ -10,6 +11,7 @@ public abstract class AbstractPlayer implements Player {
private int energy;
private Weapon weapon;
private boolean shieldDeploy;
private Action[] actions;
public AbstractPlayer(int id, Point position, int energy, Weapon weapon, boolean shieldDeploy) {
this.id = id;

View File

@ -8,4 +8,8 @@ public class ComputerPlayer extends AbstractPlayer{
public ComputerPlayer(int id, Point position, int energy, Weapon weapon, boolean shieldDeploy) {
super(id, position, energy, weapon, shieldDeploy);
}
public ComputerPlayer(int id, int energy, Weapon weapon) {
super(id, null, energy, weapon, false);
}
}

View File

@ -1,18 +1,30 @@
package fr.lnl.game.server.games.weapon;
public class Firearm implements Weapon{
int bullet;
int horizontalDistance;
int verticalDistance;
public Firearm(){
this.bullet = 10;
this.horizontalDistance = 10;
this.verticalDistance = 10;
}
@Override
public int getBullet() {
return 0;
}
@Override
public int horizontalDistance() {
public int getHorizontalDistance() {
return 0;
}
@Override
public int verticalDistance() {
public int getVerticalDistance() {
return 0;
}
}