0.1.10 • Published 3 years ago
@civ-clone/core-city v0.1.10
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 aCityis captured by anotherPlayer, this handles any associated events.Cost- AYieldmodifier, used to process a yield after it's been calculated byYieldandYieldModifier. Things like,Temples reducing unhappiness, orCivilDisorderstoppingGold,ProductionandResearch.Created- Triggered automatically on construction, this allows binding to theCityRegistryor creating aPalacefor the capital etc.Destroyed- Can further trigger aplayer:defeatedevent and can be used to clean up (removeWonders, associatedUnits etc.).ProcessYield- Used at the beginning of aTurnto handle storing surplusGoldin the treasury, contribute toResearch, etc.Yield- Used to calculate theYields aCityprovides access to.YieldModifier- To augment theYields for aCity.
AdditionalData
Adds city for Tiles and cities for Players.