The core of the unified game logic library, contains the Game struct.
PlacementSwitchError
Return values of placement_switch_player, must all be negative.
@ PLACEMENT_ALL_PENGUINS_PLACED
@ PLACEMENT_NO_MORE_FREE_TILES
@ PLACEMENT_MULTIPLE_FISH
@ PLACEMENT_ENEMY_PENGUIN
@ PLACEMENT_OUT_OF_BOUNDS
A pair of 2D coordinates, used for addressing the Game::board_grid.
The central struct of the application, holds the game data and settings.
void undo_place_penguin(Game *game)
Removes a GameLogPlacement entry from the log and undoes it.
bool validate_placement_simple(const Game *game, Coords target)
bool any_valid_placement_exists(const Game *game)
void placement_begin(Game *game)
Enters the GAME_PHASE_PLACEMENT phase, can only be called in GAME_PHASE_SETUP_DONE.
PlacementError validate_placement(const Game *game, Coords target)
int placement_switch_player(Game *game)
Performs the player switching logic for the placement phase.
void place_penguin(Game *game, Coords target)
Creates a GameLogPlacement entry. The requested placement must be valid.
void placement_end(Game *game)
Exits the GAME_PHASE_PLACEMENT phase and switches to GAME_PHASE_SETUP_DONE.