From 49dd6bda71941eea92c6b123a38705948abcdd31 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Mon, 17 Feb 2020 13:15:44 +0100 Subject: [PATCH] =?UTF-8?q?Legger=20til=20en=20fil=20som=20viser=20forel?= =?UTF-8?q?=C3=B8big=20planlagt=20klassestruktur?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/team/planlegging/robo_rally_classes.txt | 144 +++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 docs/team/planlegging/robo_rally_classes.txt diff --git a/docs/team/planlegging/robo_rally_classes.txt b/docs/team/planlegging/robo_rally_classes.txt new file mode 100644 index 0000000..08b4b09 --- /dev/null +++ b/docs/team/planlegging/robo_rally_classes.txt @@ -0,0 +1,144 @@ +Game + - List or Map + - Board + - Deck + +Deck + - List + + - void shuffle() //Randomizes order of cards in deck + - void draw(Deck other) //Draws one card from deck other. Returns false if the other deck is empty + - void draw(Deck other, int n) //Draws n cards from deck other + - void empty(Deck other) //Moves all cards in deck to deck other + - boolean isEmpty() //Checks whether there are any cards in the deck + - int size() //Gets number of cards in deck + - List getCards() //Gets copy of cards in deck in correct order + +ICard + - S getValue() //Returns the value of the card + - T getSymbol() //Returns the symbol of the card + +IGrid + - K getElement(int x, int y) + - setElement(int x, int y, K element) + - int getHeight() + - int getWidth() + +Board + - Grid + - List deadRobots; + - List aliveRobots; + + - removeDeadRobotFromBoard(Robot robot); + +Position //Immutable + int xCoordinate; + int yCoordinate; + int getXCoordinate() + int getYCoordinate() + +Direction { + NORTH, SOUTH, WEST, EAST + ???? NORTH_WEST, NORTH_EAST, SOUTH_WEST, SOUTH_EAST ???? +} + +TileType { + TILE (1), + HOLE (2), + COGWHEEL_RIGHT (3), + COGWHEEL_LEFT (4), + TRANSPORT_BAND_SLOW (5), + TRANSPORT_BAND_SLOW_RIGHT (6), + TRANSPORT_BAND_SLOW_LEFT (7), + TRANSPORT_BAND_SLOW_SIDE_ENTRANCES (8), + TRANSPORT_BAND_SLOW_SIDE_ENTRANCE_LEFT (9), + TRANSPORT_BAND_SLOW_SIDE_ENTRANCE_RIGHT (10), + TRANSPORT_BAND_FAST (11), + TRANSPORT_BAND_FAST_RIGHT (12), + TRANSPORT_BAND_FAST_LEFT (13), + TRANSPORT_BAND_FAST_SIDE_ENTRANCES (14), + TRANSPORT_BAND_FAST_SIDE_ENTRANCE_LEFT (15), + TRANSPORT_BAND_FAST_SIDE_ENTRANCE_RIGHT (16), + FLAG_1 (17), + FLAG_2 (18), + FLAG_3 (19), + FLAG_4 (20), + WRENCH (21), + WRENCH_AND_HAMMER (22), + DEATH_TILE (23) + + private final int tileID; + + private TileType(int tileID) { + this.tileID = tileID; + } + + public int getTileID() { + return this.tileID; + } + + public static TileType getTileTypeFromID(int tileID) { + for (TileType type : TileType.values()) { + if (type.tileID == tileID) { + return tile; + } + } + return null; + } +} + +WallType { + WALL_NORMAL, + WALL_CORNER, + WALL_LASER_SINGLE, + WALL_LASER_DOUBLE +} + +Tile + TileType type + Direction direction + +FunctionalTile extends Tile + doPhaseAction() //Information required has not been decided + doRoundAction() //Information required has not been decided + doStepOnAction() //Information required has not been decided. Not needed for all functional tiles + +Wall + WallType type + Direction direction + +Robot + - int playerId + - int currentDamage + - boolean inPowerDown + - int lastFlagVisited + - Position backup + + - int getDamage() + - setDamage(int damage) + - Position getPosition() + - setPosition(Position position) + - setPowerDown(boolean inPowerDown) + - boolean isInPowerDown() + +BoardLoader + - Board loadBoard(String boardFile) + +Player + - Deck + - int playerId //Both ID and name? + - string playerName + - List program + - Robot robot //Might not be needed + - boolean willTakePowerdownNextTurn + + - boolean isAlive() + - boolean getName() + - Robot getRobot() //Might not be needed + - setPowerDownNextTurn(boolean willTakePowerdown) + +IO + - Game + + - List getElementsToRender() + - ? HandleInput(?) ??? \ No newline at end of file