X-Git-Url: https://troll.desast.re/troll.git/blobdiff_plain/83de865a87657f62bc949433539351945bd04314..5c8d8d332a271b24fba9d3a2ea74a43bda8e70bd:/src/main/java/com/codingame/game/Player.java?ds=inline diff --git a/src/main/java/com/codingame/game/Player.java b/src/main/java/com/codingame/game/Player.java index 7204af3..ac96489 100644 --- a/src/main/java/com/codingame/game/Player.java +++ b/src/main/java/com/codingame/game/Player.java @@ -1,5 +1,7 @@ package com.codingame.game; +import java.util.List; + import java.util.regex.Pattern; import java.util.Scanner; import java.util.InputMismatchException; @@ -11,50 +13,12 @@ import com.codingame.gameengine.module.entities.Text; import com.codingame.gameengine.module.entities.Sprite; public class Player extends AbstractMultiplayerPlayer { - Group avatar; - Text stoneCounter; - Text message; - Sprite castle; - Text stone; + Model.Player model; + View.Player view; - private String messageString; + private String messageString = ""; public String getMessageString() { return messageString; } - private int castlePosition; - public int getCastlePosition() { return castlePosition; } - public void setCastlePosition(int pos) { castlePosition = pos; } - - private int stones; - public int getStones() { return stones; } - public void consumeStones(int n) throws InvalidAction { - if (n > stones) { - throw new InvalidAction("attempted to throw more stones than they had."); - } - setStones(stones - n); - } - public void setStones(int n) { - stones = n; - if (stones <= 0) { - stoneCounter.setText("No stones!"); - stoneCounter.setFillColor(0xff7777); - } - else if (stones == 1) { - stoneCounter.setText("1 stone"); - stoneCounter.setFillColor(0xffbb77); - } - else { - stoneCounter.setText(stones + " stones"); - } - } - - private int multiplier; - public int getMultiplier() { return multiplier; } - public void setMultiplier(int m){ multiplier = m; } - - public void adjustScore(int trollPosition) { - setScore(Math.abs(castlePosition - trollPosition)); - } - @Override public int getExpectedOutputLines() { return 1;