@civ-clone/core-city
v0.1.10
Published
Contains base functionality for the concept of a `City`, including the associated `Rule`s, `CityRegistry` and `AdditionalData`.
Downloads
24
Readme
core-city
Contains base functionality for the concept of a City
, including the associated Rule
s, CityRegistry
and AdditionalData
.
City
The main component itself. When constructed, triggers Created
Rule
s. Associated to only a Tile
and a Player
.
Utilises Yield
s in the Cost
, Yield
, YieldModifier
and ProcessYield
Rule
s.
Rule
s
Captured
- When aCity
is captured by anotherPlayer
, this handles any associated events.Cost
- AYield
modifier, used to process a yield after it's been calculated byYield
andYieldModifier
. Things like,Temple
s reducing unhappiness, orCivilDisorder
stoppingGold
,Production
andResearch
.Created
- Triggered automatically on construction, this allows binding to theCityRegistry
or creating aPalace
for the capital etc.Destroyed
- Can further trigger aplayer:defeated
event and can be used to clean up (removeWonder
s, associatedUnit
s etc.).ProcessYield
- Used at the beginning of aTurn
to handle storing surplusGold
in the treasury, contribute toResearch
, etc.Yield
- Used to calculate theYield
s aCity
provides access to.YieldModifier
- To augment theYield
s for aCity
.
AdditionalData
Adds city
for Tile
s and cities
for Player
s.