Loading...
Searching...
No Matches
CityBuilderTown.TownManager Class Reference

Detailed Description

central manager for the town demo
manages tasks, jobs, walkers, seasons

https://citybuilder.softleitner.com/manual/town

Inheritance diagram for CityBuilderTown.TownManager:
CityBuilderCore.ExtraDataBehaviour CityBuilderCore.KeyedBehaviour CityBuilderCore.ISaveData CityBuilderCore.IKeyed

Classes

class  TownManagerData
 

Public Member Functions

void LoadingChanged (bool isLoading)
 
int GetItemLimit (Item item)
 
void SetItemLimit (Item item, int quantity)
 
bool GetItemLimitReached (Item item)
 
void RegisterTask (TownTask task)
 
void DeregisterTask (TownTask task)
 
TownTask CreateTask (TownTaskData taskData, Transform parent=null)
 
CreateTask< T > (T prefab, Vector2Int point, Transform parent=null)
 
TownTask GetTask (Vector2Int point)
 
TownTask GetTask (Guid id)
 
TownTask GetTask (TownWalker townWalker)
 
BuildingReference GetHome (TownWalker _)
 
void SpawnWalker (IBuilding building)
 
bool CheckTask (Vector2Int point)
 
bool CheckHarvest (Vector2Int point)
 
TownHarvestTask CreateHarvest (Vector2Int point, Transform parent=null)
 
TownClearTask CreateClear (Vector2Int point, Transform parent=null)
 
TownBuildTask CreateBuild (Vector2Int point, Transform parent=null)
 
TownDeliverTask CreateDeliver (Vector2Int point, Transform parent=null)
 
bool Demolish (IEnumerable< Vector2Int > points)
 
int GetJobCount (TownJob job)
 
void SetJobCount (TownJob job, int count)
 
void Startup ()
 
void StartupSet ()
 
override string SaveData ()
 serializes the objects state(usually to json) and returns it
 
override void LoadData (string json)
 deserializes the serialized json data and loads the data as its new state
 
- Public Member Functions inherited from CityBuilderCore.ExtraDataBehaviour
void LoadData (string json)
 deserializes the serialized json data and loads the data as its new state
 
string SaveData ()
 serializes the objects state(usually to json) and returns it
 

Public Attributes

ItemCategory Food
 
Item Wood
 
ItemQuantity[] ItemLimits
 
Transform WalkerParent
 
Transform TaskParent
 
TownTaskSet TownTasks
 
TownJobSet TownJobs
 
TimingUnit SeasonUnit
 
ManualTownWalkerSpawner Walkers
 
TownStartupTool StartupTool
 
Fader Fader
 
TMPro.TMP_InputField TotalText
 
TMPro.TMP_InputField JoblessText
 
float MapFoodModifier = 1f
 
float MapWarmModifier = 1f
 
float MapColdModifier = 1f
 
float MapAgeModifier = 1f
 
float MapGrowthModifier = 1f
 
bool DebugSuppressWalkers
 
- Public Attributes inherited from CityBuilderCore.KeyedBehaviour
string Key
 

Static Public Attributes

static TownManager Instance
 
static int WorkParameter = Animator.StringToHash("work")
 
static int ChopParameter = Animator.StringToHash("chop")
 

Properties

float FoodModifier [get]
 
float WarmModifier [get]
 
float ColdModifier [get]
 
float AgeModifier [get]
 
float GrowthModifier [get]
 
TownSeason Season [get]
 
float Coldness [get]
 
- Properties inherited from CityBuilderCore.IKeyed

Member Function Documentation

◆ CreateTask< T >()

T CityBuilderTown.TownManager.CreateTask< T > ( T prefab,
Vector2Int point,
Transform parent = null )
inline
Type Constraints
T :TownTask 

◆ LoadData()

override void CityBuilderTown.TownManager.LoadData ( string json)
inline

deserializes the serialized json data and loads the data as its new state

Parameters
json

Implements CityBuilderCore.ISaveData.

◆ SaveData()

override string CityBuilderTown.TownManager.SaveData ( )
inline

serializes the objects state(usually to json) and returns it

Returns
serialized save data

Implements CityBuilderCore.ISaveData.