-
Notifications
You must be signed in to change notification settings - Fork 0
Data Engine API
The goal of this is to create a sort of reference manual for people unfamiliar with the Data Engine in the game. This will continuously be in flux and hopefully up-to-date but there are no guarantees.
If you find unexpected behavior or want to request additional functionality the recommended approach if you are unfamiliar with the data engine is to create a new issue to have it added or fixed.
new DGame()
This the game engine object. It contains a reference to all of the cities and is responsible to triggering the turn update.
Common methods include:
EndTurnUpdate()AddCity(DCity dCity)
new DCity(string cityName, CityController cityController)
This is a city data object. It implements the TurnUpdatable interface and needs to update every turn. It contains a reference to all of its buildings, its resources, and all the people currently in the city.
Common methods include:
TurnUpdate(int numDaysPassed)AddBuilding(Dbuilding dBuilding)AddPerson(DPerson dPerson)AddResource(DResource resource)ConsumeResource(DResource resource)GetResource(string name)
new DBuilding(DCity city, string buildingName, BuildingController buildingController)
This is a building data object. It implements the TurnUpdatable interface and needs to update every turn. It contains a reference to all of its tasks and manages its own assessment and reclamation levels.
Common methods include:
TurnUpdate(int numDaysPassed)AddTask(DTask task)GetTask(int id)
new DPerson(DCity dCity, MeepleController meepleController)
This is a person data object. It implements the TurnUpdatable interface and needs to update every turn. It contains a reference to its current task and is responsible for removing itself from its task before assigning itself to a new one.
Common methods include:
TurnUpdate(int numDaysPassed)SetTask(DTask dTask)SetTaskSlot(DTaskSlot dTaskSlot)RemoveTask()
Preferred Constructor
DResource.Create(string name, int amount)Optional Constructors
DResource.Create(string name)
DResource.Create(DResource resource)
DResource.Create(DResource resource, int amount)
This is a resource data object. It is created using a Factory pattern to ensure that resources share the same internal ID across the engine, regardless of where or when they were created. It implements the TurnUpdatable interface and needs to update every turn.
Common methods include:
TurnUpdate(int numDaysPassed)static NameToID(string name)
new DTask(DBuilding dBuilding, DResource dOutput, int dMaxPeople, string dName)
This is a task data object. It implements the TurnUpdatable interface and needs to update every turn. It has a reference to the building it belongs to and the TaskSlots that comprise it.
Common methods include:
TurnUpdate(int numDaysPassed)AddPerson(DPerson dPerson)RemovePerson(DPerson dPerson)ContainsPerson(DPerson dPerson)EnableTask()DisableTask()
new DTaskSlot(DTask dTask, DPerson dPerson=null)
This is a task slot data object. It implements the TurnUpdatable interface and needs to update every turn. It has a reference to the task it belongs to and the Person, if any, that is contained within.
Common methods include:
TurnUpdate(int numDaysPassed)AddPerson(DPerson dPerson)RemovePerson()IsFunctioning()
Data Engine Integration with UI
- Formatting
- Resource Design Pass 1
- Task Definition
- Region & Country Actions
- External References
- Event Templates