From f2741294950b1c9710089fb25fe073ae42982c6d Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Wed, 15 Mar 2023 13:51:30 +1100 Subject: [PATCH] skeleton: Added play classes --- assn-files/skeleton.md | 4 ++-- .../skeleton/{exploration.java => play.java} | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) rename src/comp1110/ass2/skeleton/{exploration.java => play.java} (79%) diff --git a/assn-files/skeleton.md b/assn-files/skeleton.md index 7437ff4..35ccd49 100644 --- a/assn-files/skeleton.md +++ b/assn-files/skeleton.md @@ -88,10 +88,10 @@ Score ## Setup board ## Create player (requires input data, probably from player number and colour) -## Exploration Phase +## Phase play ## Check Placement (requires input data, probably piece annd returns bool) ## Place Piece (requires input data, probably from player and piece type) -## Exploration Phase over (bool) +## Phase over (bool) # Objects diff --git a/src/comp1110/ass2/skeleton/exploration.java b/src/comp1110/ass2/skeleton/play.java similarity index 79% rename from src/comp1110/ass2/skeleton/exploration.java rename to src/comp1110/ass2/skeleton/play.java index 99f2b6b..e054994 100644 --- a/src/comp1110/ass2/skeleton/exploration.java +++ b/src/comp1110/ass2/skeleton/play.java @@ -1,20 +1,23 @@ package comp1110.ass2.skeleton; -public class exploration { - - +public class play { + enum gameMode { + exploration, settlement + } /** * This method is used to check if the placement of the tile is valid * It checks if the tile is placed on water or land and if the tile is placed on a tile that is already occupied. - * It also checks if the tile is placed on a tile that is not adjacent to the tile that is already placed. * + * It also checks if the tile is placed on a tile that is not adjacent to the tile that is already placed. + * + * Has input game mode */ - public boolean validPlacement() { + public boolean validPlacement(gameMode mode) { return false; // Needed to stop errors } /** - * This method picks the youngest player and gives them the first turn. + * This method picks the player and gives them the first turn. * It then asks them to place a tile. * It then asks the next player to place a tile. */ @@ -22,7 +25,7 @@ public class exploration { } - /** + /** * This method will be used to get the player to place a tile. * It will use the validPlacement method to check if the placement is valid. * It will also use the placeTile method to place the tile. @@ -50,7 +53,7 @@ public class exploration { /** * This method will be used to check if exploration phase is over. */ - public boolean explorationPhaseOver() { + public boolean phaseOver() { return false; // Needed to stop errors } }