Loading...
Searching...
No Matches
CityBuilderCore.WalkerSpawner< T > Class Template Referenceabstract

Detailed Description

base class for spawning and keeping track of walkers

Template Parameters
T
Type Constraints
T :Walker 
Inheritance diagram for CityBuilderCore.WalkerSpawner< T >:
CityBuilderCore.CyclicWalkerSpawner< T > CityBuilderCore.ManualWalkerSpawner< T > CityBuilderCore.PooledWalkerSpawner< T >

Public Member Functions

void Initialize (Transform root, Func< T, bool > onSpawning=null, Action< T > onFinished=null)
 
void Initialize (IBuilding building, Func< T, bool > onSpawning=null, Action< T > onFinished=null)
 
void Initialize< Q, P > (Transform root, MonoBehaviour owner, Func< Q > preparer, Func< Q, P > planner, Action< T, P > spawner=null, Action< T > finished=null)
 
void Initialize< Q, P > (IBuilding building, MonoBehaviour owner, Func< Q > preparer, Func< Q, P > planner, Action< T, P > spawner=null, Action< T > finished=null)
 
void Integrate (T walker, Action< T > onSpawned=null)
 

Public Attributes

Prefab
 
int Count = 1
 

Protected Member Functions

virtual void initialize ()
 
void clearWalkers ()
 
reloadActive ()
 
void spawn (Action< T > onSpawned=null, Vector2Int? start=null)
 
void spawnPrepared (MonoBehaviour owner, Func< object > preparer, Func< object, object > planner, Action< T, object > spawner=null, Action< T > onSpawned=null, Vector2Int? start=null)
 

Protected Attributes

List< T > _currentWalkers = new List<T>()
 
Transform _root
 
IBuilding _building
 

Properties

bool HasWalker [get]
 whether another walker can be spawned
 
IReadOnlyList< T > CurrentWalkers [get]