-
Notifications
You must be signed in to change notification settings - Fork 0
Iteration 4
Enan Ashaduzzaman edited this page Nov 17, 2019
·
28 revisions
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)
Feature 1: Move Pawn
- rotateWall() 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.
Helper Method:
- isRunning() -check if the game is running
Feature 2: Jump Pawn
- grabWall() 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.
Helper Method:
- isRunning() - check if the game is running
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