comp1110-ass2/assn-files/skeleton.md

112 lines
2.6 KiB
Markdown
Raw Normal View History

2023-03-14 14:39:08 +11:00
# Simple draft skeleton:
2023-03-15 17:28:02 +11:00
# Game play flow
1. Game Setup
2. Phase Setup
3. While phase isn't over do phase
4. Score
5. Phase Setup
6. While phase isn't over do phase
7. Score
8. Game End
## Game Setup
* Create player data (maybe using enums)
## Phase Setup
* Clear board
2023-03-14 14:39:08 +11:00
* Create a grid of tiles
* Create islands and assign size and location (on tiles)
2023-03-15 17:28:02 +11:00
* Create stone circles
2023-03-14 14:39:08 +11:00
* Assign villages to players
* Assign settlers to players
2023-03-15 17:28:02 +11:00
* Randomly Assign resources and statuettes to stone circles
2023-03-14 14:39:08 +11:00
2023-03-15 17:28:02 +11:00
## Phase
* Advance to next player
* Player places piece (use function piece plaging)
2023-03-14 14:39:08 +11:00
## Piece Placing
* Check placement (using function)
* Assign piece to tile
2023-03-15 17:28:02 +11:00
* If piece on stone circle, get resources and statuettes
## Valid Placement (bool)
* If piece is settler, if either of:
* on unoccupied water
* on unoccupied land adjacent to one of their pieces
* If piece is village, if both:
* on unoccupied land
* is adjacent to one of their pieces
## Phase over (bool)
If either of:
2023-03-14 14:39:08 +11:00
* All resources (not including statuettes) have been collected
* No player has any remaining moves available
2023-03-15 17:28:02 +11:00
## Scoring
* Island Scoring
* If player has pieces on > 7 islands, score 20 points
* If player has pieces on 7 islands, score 10 points
* Otherwise, score 0 points
* Links Scoring
* Score 5 points per island in players largest link
* Majorities Scoring
* Player with most pieces on each island type scores points assigned to that island
* Ties are distributed evenly rounding down
* Resources Scoring
* For each player
* For each resource
* If >3 of resource, score 20 points
* If 3 of resource, score 10 points
* If 2 of resource, score 5 points
* If player has all 4 resources, score 10 points
## Statuettes Scoring
* Each statuette is worth 4 points
2023-03-15 17:28:02 +11:00
# Functions
* Setup Functions
* Clear Board
* Board Setup
* Player Setup
* Game Functions
* Player Turn
* Place Piece
* Claim Stone Circle
* Valid placement (bool)
* Phase Over (bool)
* Scoring Functions
* Island Scoring
* Links Scoring
* Majorities Scoring
* Resources Scoring
* Statuettes Scoring
# Objects
2023-03-15 17:28:02 +11:00
## Board
* Islands (List of Islands)
* Stone Circles (List of Stone Circles)
## Island
* Size (x,y)
* Location (x,y)
* Point value (int)
2023-03-15 17:28:02 +11:00
* Tiles (List of Tiles in an grid)
## Tile
* Location (x,y)
* Type (Land, Water)
* Pieces (List of Pieces, set during game)
## Piece
* Type (Settler, Village)
* Owner (Player)
* Placed on (Tile)
## Stone Circle
* Location (x,y)
* Resources (List of Resources)
2023-03-15 17:28:02 +11:00
* Number of Statuettes (int)
* Claimed (bool, set during game)
2023-03-15 11:37:29 +11:00
## Player
* Name (string)
* Age (int)
2023-03-15 17:28:02 +11:00
* Score (int, set during game)
* Pieces (List of Pieces, set during game)