-
Notifications
You must be signed in to change notification settings - Fork 0
Iteration 4
Feature 1: Start a New Game (Vanessa Ifrah)
- createGame() creates a Quoridor game and sets the game status to "Initializing"
- setGameToReady() sets the game status to "ReadyToStart"
- setGameToRun() sets the game status to "Running" and starts the clock
Feature 2: Provide or Select User Name (Vanessa Ifrah)
- setUser(String name, String color) sets the player's name according to their color
Only one method was implemented to set the usernames instead of creating two adjacent methods createUser and selectUser. This was a design decision that moved the "creating vs. selecting" logic to the GUI in the ProvideSelectUserName page specifically. In this way, the different warnings and error messages are handled by the GUI.
Helper methods:
- checkNameList(String name) checks if the name already exists - i.e. duplicate name - and returns a boolean
- warnUser(String name) calls checkNameList(,) to decide if the user should be warned
Feature 3: Set Total Thinking Time (Andrew Ta)
- setThinkingTime(Time thinkingTime, String playerName) Given a Time object and a String of player name, this method searches for that player and set its remaining thinking time to the Time object.
Helper Method:
- getPlayerByName(String playerName) Given a player name, this method will return the player object associated with that name.
Demo:
-
Set remaining time for both players:
-
Show error if input time is invalid:
Feature 4: Initialize Board (Andrew Ta)
- initializeBoard() This method will create a new board with 81 tiles for the current game. Then, 10 walls are created for each player, and they will be put on each player's stock. Two players, black and white, will then be put on their initial positions on the board. Finally, white player is set to move first.
Demo: 3. Initialize the board and start white player's clock:
Feature 5: Rotate Wall (Enan Ashaduzzaman)
- 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 6: Grab Wall (Enan Ashaduzzaman)
- 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 7: Move Wall (Le-Li Mao)
Primary Method:
- moveWall(TOWall.Direction side) Perform a move on the currently selected wall toward a direction (given by variable side)
Helper Method:
- isRunning() -check if the game is running
- isWallPositionValid(int row, int col) -Check if a given row and col for a wall is valid
Feature 8: Drop Wall (Le-Li Mao)
Primary Method:
- dropWall() -Perform a drop wall Operation that drops the currently held wall
- validatePosition() -(Made by Sacha) Used to validate position and prevent the invalid wall from being dropped.
Helper Method:
- clonePosition(GamePosition oldPosition) Create a copy of the given position object.
- clonePlayerPosition(PlayerPosition playerPos) Create a copy of the given PlayerPosition object.
- isRunning() - check if the game is running
- isWhitePlayer() - check who if the current player to move is white
Feature 9: Save Position (Mitchell Keeley)
Primary Method:
- savePosition(String filename) - Save the current game position as a file in the filesystem
Helper Method:
- _ writeToNewFile(String filename)_ - A method to create and write to a new save file
- _ writeToExistingFile(String filename)_ - A method to write to an existing save file
- _ userOverwritePrompt(String filename)_ - A method to prompt the user for permission to overwrite the existing file
- _ saveCurrentGamePositionAsFile(String filename)_ - A method to save the current GamePosition as a file
Feature 10: Load Position (Mitchell Keeley)
Primary Method:
- loadPosition(String filename) - Load a new game position from a file in the filesystem
Helper Method:
- _ checkLoadFileIsValid(String filename)_ - A method to check if the load file is a valid file
- _ loadMoveDataFromFile(String loadFile) _ - A method to load the game data from the specified file into the game
Feature 11: Validate Position (Sacha Lévy) Primary Method:
- validatePosition() - Checks the board for any invalid wall positions, then if game has a wall move candidate check if its validity otherwise check validity of player position.
Helper Method:
- doWallsOverlap() - full check of walls on board (both black and white), looking for overlapping walls
- _isWallCandidateOverlapping() - checking if the wall is overlapping with any other on board
- isPlayerPositionValid() - check if the player position is valid (on board)
- isPlayerOverlapping() - check if the players positions overlap
Feature 12: Switch Player (Sacha Lévy) Primary Method:
- SwitchPlayer() - Set the current player to be the next Player of the current next player and the next player to become the current player.
Feature 1: Start a New Game
Fully implemented and fully pass all step definitions.
Feature 2: Provide or Select User Name
Fully implemented and fully pass all step definitions.
Feature 3: Set Total Thinking Time
Fully implemented and fully pass all step definitions.
Feature 4: Initialize Board
Fully implemented and fully pass all step definitions.
Feature 5: Rotate Wall
Fully implemented and fully pass all step definitions.
Feature 6: Grab Wall
Fully implemented and fully pass all step definitions.
Feature 7: Move Wall
Fully implemented and fully pass all step definitions.
Feature 8: Drop Wall
Fully implemented and fully pass all step definitions.
Feature 9: Save Position
Fully implemented and fully pass all step definitions.
Feature 10: Load Position
Fully implemented and fully pass all step definitions.
Feature 11: Validate Position
Fully implemented and fully pass all step definitions.
Feature 12: Switch Player
Fully implemented and fully pass all step definitions.
TOGame
- Time playerOneTime;
- Time playerTwoTime;
- playerOne;
- playerTwo;
- playerToMove;
TOWall
- enum Direction {Horizontal,Vertical};
- enum Side {Up,Down,Left,Right};
- Integer id;
- Integer row;
- Integer col;
- Direction dir;
TOPlayer
- enum Color {White,Black};
- 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
- getBlackWallInStock() - Return the number of walls in stock for the black player
- getWhiteWallOnBoard() - Return a list of wall transfer objects on the board belonging to the white player
- getBlackWallOnBoard() - Return a list of wall transfer objects on the board belonging to a black player
- getWallInHand() - Return the Wall transfer object of the current wall candidate
- getPlayers() - Return a list of transfer object player in the current game
- convertWall(Wall aWall) - Convert a Wall object to a TOWall object
Mitchell Keeley
- tileToString(Tile tile) - Translate a tile into a save compatible string
- directionToString(Direction direction) - Translate a Direction into a save compatible string
- charToDirection(char letter) - Translate a character into the corresponding Direction
Group 10 | ECSE 223 Model Based Programming