Loading...
Searching...
No Matches
CityBuilderTown.TownTask Class Referenceabstract

Detailed Description

tasks are behaviours that contain a series of action for a walker to complete
this can be as simple as an item pickup or more complex like a farming field that changes throughout the years
they are either managed(creation, persistence, termination) globally by the TownManager or locally by, for example, a building component
when they are not otherwise occupied TownWalkers query the TownManager for the most appropriate task which depends on their position and job

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

Inheritance diagram for CityBuilderTown.TownTask:
CityBuilderCore.KeyedBehaviour CityBuilderCore.IKeyed CityBuilderTown.TownBuildTask CityBuilderTown.TownClearTask CityBuilderTown.TownDeliverTask CityBuilderTown.TownDemolishTask CityBuilderTown.TownDistributionTask CityBuilderTown.TownFieldTask CityBuilderTown.TownGatherTask CityBuilderTown.TownHarvestTask CityBuilderTown.TownItemTask CityBuilderTown.TownPathTask CityBuilderTown.TownPlantTask CityBuilderTown.TownWorkTask

Public Member Functions

virtual bool CanStartTask (TownWalker walker)
 
WalkerAction[] StartTask (TownWalker walker)
 
void ContinueTask (TownWalker walker)
 
void FinishTask (TownWalker walker, ProcessState process)
 
virtual void Terminate ()
 
virtual void SignalTask (TownWalker walker, string key)
 
virtual bool ProgressTask (TownWalker walker, string key)
 
virtual void SuspendTask ()
 
virtual void ResumeTask ()
 
virtual string GetDescription ()
 
virtual string GetDebugText ()
 
virtual void OnMessages (string e)
 use when a single string has to be split into several messages
by default the parameter is split by spaces
 
virtual void OnMessage (string e)
 puts a message into the characters messaging pipeline
 
TownTaskData SaveData ()
 
void LoadData (TownTaskData data)
 

Public Attributes

TownJob Job
 
Sprite Icon
 
Transform Visual
 
GameObject Tool
 
UnityEvent< string > MessageReceived
 
MessageEvent[] MessageEvents
 
- Public Attributes inherited from CityBuilderCore.KeyedBehaviour
string Key
 

Protected Member Functions

virtual void Awake ()
 
virtual void Update ()
 
virtual void OnDestroy ()
 
virtual string saveExtras ()
 
virtual void loadExtras (string json)
 

Protected Attributes

bool _isTerminated
 
bool _isSuspended
 

Properties

Guid Id = Guid.NewGuid() [get]
 
virtual IEnumerable< TownWalkerWalkers [get]
 
Vector2Int Point [get]
 
- Properties inherited from CityBuilderCore.IKeyed

Member Function Documentation

◆ OnMessage()

virtual void CityBuilderTown.TownTask.OnMessage ( string e)
inlinevirtual

puts a message into the characters messaging pipeline

Parameters
e

◆ OnMessages()

virtual void CityBuilderTown.TownTask.OnMessages ( string e)
inlinevirtual

use when a single string has to be split into several messages
by default the parameter is split by spaces

Parameters
e