-
Notifications
You must be signed in to change notification settings - Fork 0
Iteration 4
Implementation of both player movement features took place within the same controller method. This was possible since the created state machine would handle the logic of whether or not the pawn should move or jump at a specific instance in the game.
Controller Method
movePawn(TOPlayer.side side) Performs the movement of the player's pawn during the respective player's turn. When the feature is called, the feature will first check if there is a wall in hand. If so, the feature cannot be implemented since the keyboard movements will be allocated towards the wall.
Helper Method:
- isRunning() -check if the game is running
Feature 1: Move Pawn
Perform the rotation of a selected wall during a player's turn. When this feature is called, the feature will first check if the player has an active wall on the board. If so, the feature can be implemented. If the wall is horizontal before the feature is performed, then the wall will become vertical after the feature is called. The vice versa of the previous statement is also true.
Feature 2: Jump Pawn
Perform the grabbing of a wall from the wall stock of the respective player who calls this feature. The feature will first check if the wall stock if empty. If it is empty, it will throw a message to the user indicating this scenario. The feature then checks if there is already an active wall on the board. If there is already an active wall on the board, the user should not be able to grab another wall. If both of the previous scenarios pass, the feature will grab a wall from the respective player's wall stock and place it on the board game.
Feature 1: Move Pawn
Fully implemented and fully pass all step definitions.
Feature 2: Jump Pawn
Fully implemented and fully pass all step definitions.
TOPlayer
- enum Color {White,Black};
- enum Side {Up,Down,Left,Right,UpRight,UpLeft,DownRight,DownLeft);
- Integer row;
- Integer col;
- Color color;
Le-Li Mao
- getCurrentPlayerName() - Get the name of the current player to notify the user it is their turn after drop wall
- getWhiteWallInStock() - Return the number of walls in stock for the white player
Group 10 | ECSE 223 Model Based Programming