From e81fb4af2e3bc06a04bf4eb6cc2a4662af950c5b Mon Sep 17 00:00:00 2001 From: Katchan Date: Mon, 18 Oct 2021 18:19:16 +0200 Subject: [PATCH] Edit ComputerPlayer abd Firearm constructor --- .../game/server/games/player/AbstractPlayer.java | 2 ++ .../game/server/games/player/ComputerPlayer.java | 4 ++++ .../fr/lnl/game/server/games/weapon/Firearm.java | 16 ++++++++++++++-- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/fr/lnl/game/server/games/player/AbstractPlayer.java b/server/src/main/java/fr/lnl/game/server/games/player/AbstractPlayer.java index e4195a4..55a2354 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/AbstractPlayer.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/AbstractPlayer.java @@ -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; diff --git a/server/src/main/java/fr/lnl/game/server/games/player/ComputerPlayer.java b/server/src/main/java/fr/lnl/game/server/games/player/ComputerPlayer.java index 5428852..913962c 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/ComputerPlayer.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/ComputerPlayer.java @@ -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); + } } diff --git a/server/src/main/java/fr/lnl/game/server/games/weapon/Firearm.java b/server/src/main/java/fr/lnl/game/server/games/weapon/Firearm.java index 4527672..26f596b 100644 --- a/server/src/main/java/fr/lnl/game/server/games/weapon/Firearm.java +++ b/server/src/main/java/fr/lnl/game/server/games/weapon/Firearm.java @@ -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; } }