From 03c7e95e0174a468e1e0fd608b52002c30310fab Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Mon, 20 Apr 2020 14:19:20 +0200 Subject: [PATCH] Legger til kommentarer for individuelle enum verdier --- .../roborally/elementproperties/Action.java | 21 ++++++++ .../elementproperties/Direction.java | 24 ++++++++++ .../elementproperties/GameState.java | 36 ++++++++++---- .../elementproperties/ParticleType.java | 12 +++++ .../roborally/elementproperties/RobotID.java | 24 ++++++++++ .../roborally/elementproperties/TileType.java | 48 +++++++++++++++++++ 6 files changed, 156 insertions(+), 9 deletions(-) diff --git a/src/main/java/inf112/fiasko/roborally/elementproperties/Action.java b/src/main/java/inf112/fiasko/roborally/elementproperties/Action.java index 2c1efb5..2a5fd01 100644 --- a/src/main/java/inf112/fiasko/roborally/elementproperties/Action.java +++ b/src/main/java/inf112/fiasko/roborally/elementproperties/Action.java @@ -4,11 +4,32 @@ package inf112.fiasko.roborally.elementproperties; * This enum represents an action on a programming card */ public enum Action { + /** + * The action of rotating a robot clockwise + */ ROTATE_RIGHT, + /** + * The action of rotating a robot counterclockwise + */ ROTATE_LEFT, + /** + * The action of rotating a robot 180 degrees + */ U_TURN, + /** + * The action of moving a robot one tile forward + */ MOVE_1, + /** + * The action of moving a robot two tiles forward + */ MOVE_2, + /** + * The action of moving a robot three tiles forward + */ MOVE_3, + /** + * The action of moving a robot one tile backward + */ BACK_UP } \ No newline at end of file diff --git a/src/main/java/inf112/fiasko/roborally/elementproperties/Direction.java b/src/main/java/inf112/fiasko/roborally/elementproperties/Direction.java index 76733be..32f0a96 100644 --- a/src/main/java/inf112/fiasko/roborally/elementproperties/Direction.java +++ b/src/main/java/inf112/fiasko/roborally/elementproperties/Direction.java @@ -4,13 +4,37 @@ package inf112.fiasko.roborally.elementproperties; * This enum represents all possible directions for an element on the board */ public enum Direction { + /** + * The north direction + */ NORTH(1), + /** + * The north-east direction + */ NORTH_EAST(2), + /** + * The east direction + */ EAST(3), + /** + * The south-east direction + */ SOUTH_EAST(4), + /** + * The south direction + */ SOUTH(5), + /** + * The south-west direction + */ SOUTH_WEST(6), + /** + * The west direction + */ WEST(7), + /** + * The north-west direction + */ NORTH_WEST(8); private final int directionID; diff --git a/src/main/java/inf112/fiasko/roborally/elementproperties/GameState.java b/src/main/java/inf112/fiasko/roborally/elementproperties/GameState.java index b562a10..14088ac 100644 --- a/src/main/java/inf112/fiasko/roborally/elementproperties/GameState.java +++ b/src/main/java/inf112/fiasko/roborally/elementproperties/GameState.java @@ -5,23 +5,41 @@ package inf112.fiasko.roborally.elementproperties; */ public enum GameState { - //Gives the game Access to the client and server + /** + * At the absolute start of the game, before anything has happended + */ BEGINNING_OF_GAME, - //Indicates that the users' input is being run. The board should be shown + /** + * Indicates that the users' input is being run. The board should be shown + */ RUNNING_PROGRAMS, - //Indicates that + /** + * The game is in the process of setting up things which are needed before it's ready for user input + */ INITIAL_SETUP, - //Indicates that the game is in the process of cleaning up after a turn + /** + * Indicates that the game is in the process of cleaning up after a turn + */ TURN_CLEANUP, - //Indicates that the user is in the process of choosing cards + /** + * Indicates that the user is in the process of choosing cards + */ CHOOSING_CARDS, - //Indicates that the user is in the process of choosing whether to power down + /** + * Indicates that the user is in the process of choosing whether to power down + */ CHOOSING_POWER_DOWN, - //Indicates that the user is in the process of choosing whether to stay in power down + /** + * Indicates that the user is in the process of choosing whether to stay in power down + */ CHOOSING_STAY_IN_POWER_DOWN, - //Indicates that the game is won by a player + /** + * Indicates that the game is won by a player + */ GAME_IS_WON, - //Indicates that the game is currently waiting for something + /** + * Indicates that the game is currently waiting for something + */ LOADING } diff --git a/src/main/java/inf112/fiasko/roborally/elementproperties/ParticleType.java b/src/main/java/inf112/fiasko/roborally/elementproperties/ParticleType.java index 5e5e7fc..e830e91 100644 --- a/src/main/java/inf112/fiasko/roborally/elementproperties/ParticleType.java +++ b/src/main/java/inf112/fiasko/roborally/elementproperties/ParticleType.java @@ -1,9 +1,21 @@ package inf112.fiasko.roborally.elementproperties; public enum ParticleType { + /** + * The beam emitting from a single laser + */ LASER_BEAM_SINGLE(1), + /** + * The beam emitting from a double laser + */ LASER_BEAM_DOUBLE(2), + /** + * The beam emitted where two single beams cross + */ LASER_BEAM_SINGLE_CROSS(3), + /** + * The beam emitted where two double beams cross + */ LASER_BEAM_DOUBLE_CROSS(4); private final int particleTypeID; diff --git a/src/main/java/inf112/fiasko/roborally/elementproperties/RobotID.java b/src/main/java/inf112/fiasko/roborally/elementproperties/RobotID.java index 787cf0f..75ec501 100644 --- a/src/main/java/inf112/fiasko/roborally/elementproperties/RobotID.java +++ b/src/main/java/inf112/fiasko/roborally/elementproperties/RobotID.java @@ -4,13 +4,37 @@ package inf112.fiasko.roborally.elementproperties; * This class represents an id for marking specific robots */ public enum RobotID { + /** + * The id of the first robot (white) + */ ROBOT_1(1), + /** + * The id of the second robot (pink) + */ ROBOT_2(2), + /** + * The id of the third robot (light green) + */ ROBOT_3(3), + /** + * The id of the fourth robot (blue) + */ ROBOT_4(4), + /** + * The id of the fifth robot (yellow) + */ ROBOT_5(5), + /** + * The id of the sixth robot (dark green) + */ ROBOT_6(6), + /** + * The id of the seventh robot (orange) + */ ROBOT_7(7), + /** + * The id of the eight robot (red) + */ ROBOT_8(8); private final int robotID; diff --git a/src/main/java/inf112/fiasko/roborally/elementproperties/TileType.java b/src/main/java/inf112/fiasko/roborally/elementproperties/TileType.java index b56a454..965567f 100644 --- a/src/main/java/inf112/fiasko/roborally/elementproperties/TileType.java +++ b/src/main/java/inf112/fiasko/roborally/elementproperties/TileType.java @@ -4,21 +4,69 @@ package inf112.fiasko.roborally.elementproperties; * This enum represents all possible tile types */ public enum TileType { + /** + * The generic tile without functionality + */ TILE(1), + /** + * A hole which robots might fall into + */ HOLE(2), + /** + * A cogwheel rotating to the right + */ COGWHEEL_RIGHT(3), + /** + * A cogwheel rotating to the left + */ COGWHEEL_LEFT(4), + /** + * A slow and straight conveyor belt + */ CONVEYOR_BELT_SLOW(5), + /** + * A slow conveyor belt with a rightward bend + */ CONVEYOR_BELT_SLOW_RIGHT(6), + /** + * A slow conveyor belt with a leftward bend + */ CONVEYOR_BELT_SLOW_LEFT(7), + /** + * A slow conveyor belt with entrances both to the left and to the right + */ CONVEYOR_BELT_SLOW_SIDE_ENTRANCES(8), + /** + * A slow conveyor belt with one entrance on the left and one from behind + */ CONVEYOR_BELT_SLOW_SIDE_ENTRANCE_LEFT(9), + /** + * A slow conveyor belt with one entrance on the right and one from behind + */ CONVEYOR_BELT_SLOW_SIDE_ENTRANCE_RIGHT(10), + /** + * A fast and straight conveyor belt + */ CONVEYOR_BELT_FAST(11), + /** + * A fast conveyor belt with a rightward bend + */ CONVEYOR_BELT_FAST_RIGHT(12), + /** + * A fast conveyor belt with a leftward bend + */ CONVEYOR_BELT_FAST_LEFT(13), + /** + * A fast conveyor belt with one entrance on the left and one from behind + */ CONVEYOR_BELT_FAST_SIDE_ENTRANCES(14), + /** + * A fast conveyor belt with one entrance on the left and one from behind + */ CONVEYOR_BELT_FAST_SIDE_ENTRANCE_LEFT(15), + /** + * A fast conveyor belt with one entrance on the right and one from behind + */ CONVEYOR_BELT_FAST_SIDE_ENTRANCE_RIGHT(16), FLAG_1(17), FLAG_2(18),