Skip to content

civ-clone/core-city

Repository files navigation

core-city

Contains base functionality for the concept of a City, including the associated Rules, CityRegistry and AdditionalData.

City

The main component itself. When constructed, triggers Created Rules. Associated to only a Tile and a Player. Utilises Yields in the Cost, Yield, YieldModifier and ProcessYield Rules.

Rules

  • Captured - When a City is captured by another Player, this handles any associated events.
  • Cost - A Yield modifier, used to process a yield after it's been calculated by Yield and YieldModifier. Things like, Temples reducing unhappiness, or CivilDisorder stopping Gold, Production and Research.
  • Created - Triggered automatically on construction, this allows binding to the CityRegistry or creating a Palace for the capital etc.
  • Destroyed - Can further trigger a player:defeated event and can be used to clean up (remove Wonders, associated Units etc.).
  • ProcessYield - Used at the beginning of a Turn to handle storing surplus Gold in the treasury, contribute to Research, etc.
  • Yield - Used to calculate the Yields a City provides access to.
  • YieldModifier - To augment the Yields for a City.

AdditionalData

Adds city for Tiles and cities for Players.