Legger til kommentarer for individuelle enum verdier

This commit is contained in:
Kristian Knarvik 2020-04-20 14:19:20 +02:00
parent 8df8432f62
commit 03c7e95e01
6 changed files with 156 additions and 9 deletions

View File

@ -4,11 +4,32 @@ package inf112.fiasko.roborally.elementproperties;
* This enum represents an action on a programming card * This enum represents an action on a programming card
*/ */
public enum Action { public enum Action {
/**
* The action of rotating a robot clockwise
*/
ROTATE_RIGHT, ROTATE_RIGHT,
/**
* The action of rotating a robot counterclockwise
*/
ROTATE_LEFT, ROTATE_LEFT,
/**
* The action of rotating a robot 180 degrees
*/
U_TURN, U_TURN,
/**
* The action of moving a robot one tile forward
*/
MOVE_1, MOVE_1,
/**
* The action of moving a robot two tiles forward
*/
MOVE_2, MOVE_2,
/**
* The action of moving a robot three tiles forward
*/
MOVE_3, MOVE_3,
/**
* The action of moving a robot one tile backward
*/
BACK_UP BACK_UP
} }

View File

@ -4,13 +4,37 @@ package inf112.fiasko.roborally.elementproperties;
* This enum represents all possible directions for an element on the board * This enum represents all possible directions for an element on the board
*/ */
public enum Direction { public enum Direction {
/**
* The north direction
*/
NORTH(1), NORTH(1),
/**
* The north-east direction
*/
NORTH_EAST(2), NORTH_EAST(2),
/**
* The east direction
*/
EAST(3), EAST(3),
/**
* The south-east direction
*/
SOUTH_EAST(4), SOUTH_EAST(4),
/**
* The south direction
*/
SOUTH(5), SOUTH(5),
/**
* The south-west direction
*/
SOUTH_WEST(6), SOUTH_WEST(6),
/**
* The west direction
*/
WEST(7), WEST(7),
/**
* The north-west direction
*/
NORTH_WEST(8); NORTH_WEST(8);
private final int directionID; private final int directionID;

View File

@ -5,23 +5,41 @@ package inf112.fiasko.roborally.elementproperties;
*/ */
public enum GameState { 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, 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, 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, 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, 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, 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, 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, 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, GAME_IS_WON,
//Indicates that the game is currently waiting for something /**
* Indicates that the game is currently waiting for something
*/
LOADING LOADING
} }

View File

@ -1,9 +1,21 @@
package inf112.fiasko.roborally.elementproperties; package inf112.fiasko.roborally.elementproperties;
public enum ParticleType { public enum ParticleType {
/**
* The beam emitting from a single laser
*/
LASER_BEAM_SINGLE(1), LASER_BEAM_SINGLE(1),
/**
* The beam emitting from a double laser
*/
LASER_BEAM_DOUBLE(2), LASER_BEAM_DOUBLE(2),
/**
* The beam emitted where two single beams cross
*/
LASER_BEAM_SINGLE_CROSS(3), LASER_BEAM_SINGLE_CROSS(3),
/**
* The beam emitted where two double beams cross
*/
LASER_BEAM_DOUBLE_CROSS(4); LASER_BEAM_DOUBLE_CROSS(4);
private final int particleTypeID; private final int particleTypeID;

View File

@ -4,13 +4,37 @@ package inf112.fiasko.roborally.elementproperties;
* This class represents an id for marking specific robots * This class represents an id for marking specific robots
*/ */
public enum RobotID { public enum RobotID {
/**
* The id of the first robot (white)
*/
ROBOT_1(1), ROBOT_1(1),
/**
* The id of the second robot (pink)
*/
ROBOT_2(2), ROBOT_2(2),
/**
* The id of the third robot (light green)
*/
ROBOT_3(3), ROBOT_3(3),
/**
* The id of the fourth robot (blue)
*/
ROBOT_4(4), ROBOT_4(4),
/**
* The id of the fifth robot (yellow)
*/
ROBOT_5(5), ROBOT_5(5),
/**
* The id of the sixth robot (dark green)
*/
ROBOT_6(6), ROBOT_6(6),
/**
* The id of the seventh robot (orange)
*/
ROBOT_7(7), ROBOT_7(7),
/**
* The id of the eight robot (red)
*/
ROBOT_8(8); ROBOT_8(8);
private final int robotID; private final int robotID;

View File

@ -4,21 +4,69 @@ package inf112.fiasko.roborally.elementproperties;
* This enum represents all possible tile types * This enum represents all possible tile types
*/ */
public enum TileType { public enum TileType {
/**
* The generic tile without functionality
*/
TILE(1), TILE(1),
/**
* A hole which robots might fall into
*/
HOLE(2), HOLE(2),
/**
* A cogwheel rotating to the right
*/
COGWHEEL_RIGHT(3), COGWHEEL_RIGHT(3),
/**
* A cogwheel rotating to the left
*/
COGWHEEL_LEFT(4), COGWHEEL_LEFT(4),
/**
* A slow and straight conveyor belt
*/
CONVEYOR_BELT_SLOW(5), CONVEYOR_BELT_SLOW(5),
/**
* A slow conveyor belt with a rightward bend
*/
CONVEYOR_BELT_SLOW_RIGHT(6), CONVEYOR_BELT_SLOW_RIGHT(6),
/**
* A slow conveyor belt with a leftward bend
*/
CONVEYOR_BELT_SLOW_LEFT(7), 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), 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), 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), CONVEYOR_BELT_SLOW_SIDE_ENTRANCE_RIGHT(10),
/**
* A fast and straight conveyor belt
*/
CONVEYOR_BELT_FAST(11), CONVEYOR_BELT_FAST(11),
/**
* A fast conveyor belt with a rightward bend
*/
CONVEYOR_BELT_FAST_RIGHT(12), CONVEYOR_BELT_FAST_RIGHT(12),
/**
* A fast conveyor belt with a leftward bend
*/
CONVEYOR_BELT_FAST_LEFT(13), 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), 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), 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), CONVEYOR_BELT_FAST_SIDE_ENTRANCE_RIGHT(16),
FLAG_1(17), FLAG_1(17),
FLAG_2(18), FLAG_2(18),