Skip to content

Commit

Permalink
Add comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
kberg committed Jun 27, 2024
1 parent 7b48964 commit d9b4274
Showing 1 changed file with 36 additions and 8 deletions.
44 changes: 36 additions & 8 deletions src/server/IGame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ export interface IGame extends Logger {
inputsThisRound: number;
resettable: boolean;
generation: number;
/**
* Stores the state of each global parameter at the end of each generation.
*
* Used for rendering game-end statistics.
*/
globalsPerGeneration: Array<Partial<Record<GlobalParameter, number>>>;
phase: Phase;
projectDeck: ProjectDeck;
Expand Down Expand Up @@ -82,18 +87,23 @@ export interface IGame extends Logger {
someoneHasRemovedOtherPlayersPlants: boolean;
// Syndicate Pirate Raids
syndicatePirateRaider?: PlayerId;
// Gagarin Mobile Base
/**
* The spaces Gagarin Mobile Base has visited. The zeroeth element contains
* its current location, and as it moves the new location is added to the front.
*/
gagarinBase: Array<SpaceId>;
// St. Joseph of Cupertino Mission
/**
* The spaces where a St. Joseph of Cupertino Mission's cathedrals are.
*/
stJosephCathedrals: Array<SpaceId>;
// Mars Nomads
nomadSpace: SpaceId | undefined;
// Trade Embargo
tradeEmbargo: boolean;
// Behold The Emperor
/** True when Behold The Emperor is in effect this coming Turmoil phase */
beholdTheEmperor: boolean;

// The set of tags available in this game.
/** The set of tags available in this game. */
readonly tags: ReadonlyArray<Tag>;
// Function use to properly start the game: with project draft or with research phase
gotoInitialPhase(): void;
Expand Down Expand Up @@ -131,10 +141,19 @@ export interface IGame extends Logger {
playerHasPassed(player: IPlayer): void;
hasResearched(player: IPlayer): boolean;
playerIsFinishedWithResearchPhase(player: IPlayer): void;
/**
* Called when a player has finished taking actions. It sets up
* the next player, or moves to the production phase.
*/
playerIsFinishedTakingActions(): void;
// Part of final greenery placement.
/**
* Returns true if the player may place a greenery tile.
* Applicable only during final greenery placement.
*/
canPlaceGreenery(player: IPlayer): boolean;
// Called when a player cannot or chose not to place any more greeneries.
/**
* Called during final greenery placement when a player cannot or chooses not to place any more greeneries.
*/
playerIsDoneWithGame(player: IPlayer): void;
/**
* Find the next player who might be able to place a final greenery and ask them.
Expand All @@ -150,9 +169,18 @@ export interface IGame extends Logger {
getTemperature(): number;
getGeneration(): number;
getPassedPlayers():ReadonlyArray<Color>;
// addTile applies to the Mars board, but not the Moon board, see MoonExpansion.addTile for placing
// a tile on The Moon.
/**
* Add `tile` to `space` for `player`. Triggers all effects that come with placing a tile.
*
* This only applies to the Mars board. See MoonExpansion.addTile for placing
* a tile on The Moon.
*/
addTile(player: IPlayer, space: Space, tile: Tile): void;
/**
* Add `tile` to `space` for `player` without triggering any effects.
*
* This only applies to the Mars board.
*/
simpleAddTile(player: IPlayer, space: Space, tile: Tile): void;
/**
* Gives all the bonuses a player may gain when placing a tile on a space.
Expand Down

0 comments on commit d9b4274

Please sign in to comment.