From 19e5f19b198d0f3ac7d1f7c287f49da0ca346a01 Mon Sep 17 00:00:00 2001 From: Katchan Date: Thu, 28 Oct 2021 23:18:31 +0200 Subject: [PATCH] Add increment function --- .../java/fr/lnl/game/server/games/player/AbstractPlayer.java | 4 ++++ .../src/main/java/fr/lnl/game/server/games/player/Player.java | 1 + 2 files changed, 5 insertions(+) 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 c25567e..42952df 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 @@ -78,4 +78,8 @@ public abstract class AbstractPlayer implements Player { public void decrementEnergy(int energy){ this.energy -= energy; } + + public void incrementEnergy(int energy){ + this.energy += energy; + } } diff --git a/server/src/main/java/fr/lnl/game/server/games/player/Player.java b/server/src/main/java/fr/lnl/game/server/games/player/Player.java index bbfffcc..ea0ad36 100644 --- a/server/src/main/java/fr/lnl/game/server/games/player/Player.java +++ b/server/src/main/java/fr/lnl/game/server/games/player/Player.java @@ -19,4 +19,5 @@ public interface Player { ClassPlayer getClassPlayer(); void setPoint(Point point); void decrementEnergy(int energy); + void incrementEnergy(int energy); }