Loading...
Searching...
No Matches
CityBuilderCore.IItemsDispenserManager Interface Reference

Detailed Description

keeps track of all the IItemsDispenser and calculates the dispenser a retriever goes for

Inheritance diagram for CityBuilderCore.IItemsDispenserManager:
CityBuilderCore.DefaultItemManager

Public Member Functions

void Add (IItemsDispenser dispenser)
 adds a dispenser to the manager so it can be found by retrievers
 
void Remove (IItemsDispenser dispenser)
 removes a previously added retriever so it can no longer be found be retrievers
 
IItemsDispenser GetDispenser (string key, Vector3 position, float maxDistance)
 looks for the closest dispenser that has the right key
 
bool HasDispenser (string key, Vector3 position, float maxDistance)
 checks if there is a dispenser with the right key in the vicinity
 

Member Function Documentation

◆ Add()

void CityBuilderCore.IItemsDispenserManager.Add ( IItemsDispenser dispenser)

adds a dispenser to the manager so it can be found by retrievers

Parameters
dispenserthe retrievers to add

Implemented in CityBuilderCore.DefaultItemManager.

◆ GetDispenser()

IItemsDispenser CityBuilderCore.IItemsDispenserManager.GetDispenser ( string key,
Vector3 position,
float maxDistance )

looks for the closest dispenser that has the right key

Parameters
keykey used to discern different types of dispensers(rock, tree, gold, ...)
positionabsolute world position of the retriever
maxDistancemaximum distance between dispenser and retriever
Returns
the closest dispenser if one was found

Implemented in CityBuilderCore.DefaultItemManager.

◆ HasDispenser()

bool CityBuilderCore.IItemsDispenserManager.HasDispenser ( string key,
Vector3 position,
float maxDistance )

checks if there is a dispenser with the right key in the vicinity

Parameters
keykey used to discern different types of dispensers(rock, tree, gold, ...)
positionabsolute world position of the retriever
maxDistancemaximum distance between dispenser and retriever
Returns
true if a dispenser is available

Implemented in CityBuilderCore.DefaultItemManager.

◆ Remove()

void CityBuilderCore.IItemsDispenserManager.Remove ( IItemsDispenser dispenser)

removes a previously added retriever so it can no longer be found be retrievers

Parameters
dispenserthe dispenser to remove

Implemented in CityBuilderCore.DefaultItemManager.