ClassicCityBuilderKit 1.8.8
|
default implementation for the resource systems
manages global items as well as finding the right givers, receivers and dispensers for items
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 | |
BuildingComponentPath< IItemGiver > | GetGiverPath (IBuilding building, Vector2Int? currentPoint, ItemQuantity items, float maxDistance, PathType pathType, object pathTag=null) |
attempts to find an IItemGiver and a path to it for a needed item | |
BuildingComponentPathQuery< IItemGiver > | GetGiverPathQuery (IBuilding building, Vector2Int? currentPoint, ItemQuantity items, float maxDistance, PathType pathType, object pathTag=null) |
BuildingComponentPath< IItemReceiver > | GetReceiverPath (IBuilding building, Vector2Int? currentPoint, ItemQuantity items, float maxDistance, PathType pathType, object pathTag=null, int currentPriority=0) |
attempts to find a receiver and a path to it for an item a walker wants to deliver | |
BuildingComponentPathQuery< IItemReceiver > | GetReceiverPathQuery (IBuilding building, Vector2Int? currentPoint, ItemQuantity items, float maxDistance, PathType pathType, object pathTag=null, int currentPriority=0) |
Public Attributes | |
ItemStorage | ItemStorage |
ItemQuantity[] | StartItems |
bool | PrioritizeEmptyReceivers |
Protected Member Functions | |
virtual void | Awake () |
virtual void | Start () |
virtual bool | isValid (IBuilding building, ItemQuantity items, IItemGiver giver) |
virtual bool | isValid (IBuilding building, ItemQuantity items, IItemReceiver receiver, int currentPriority=0) |
virtual bool | isDiscarded (ItemQuantity items, IItemGiver currentGiver, float currentPathDistance, IItemGiver potentialGiver, float potentialBuildingDistance) |
virtual bool | isDiscarded (ItemQuantity items, IItemReceiver currentReceiver, float currentPathDistance, IItemReceiver potentialReceiver, float potentialBuildingDistance) |
virtual bool | isMoreImportant (ItemQuantity items, IItemGiver currentGiver, float currentPathDistance, IItemGiver potentialGiver, float potentialPathDistance) |
virtual bool | isMoreImportant (ItemQuantity items, IItemReceiver currentReceiver, float currentPathDistance, IItemReceiver potentialReceiver, float potentialPathDistance) |
Properties | |
ItemStorage | Items [get] |
storage that holds the items of the global storage | |
Properties inherited from CityBuilderCore.IGlobalStorage |
|
inline |
adds a dispenser to the manager so it can be found by retrievers
dispenser | the retrievers to add |
Implements CityBuilderCore.IItemsDispenserManager.
|
inline |
looks for the closest dispenser that has the right key
key | key used to discern different types of dispensers(rock, tree, gold, ...) |
position | absolute world position of the retriever |
maxDistance | maximum distance between dispenser and retriever |
Implements CityBuilderCore.IItemsDispenserManager.
|
inline |
attempts to find an IItemGiver and a path to it for a needed item
building | home building of the walker if any |
currentPoint | current position of the walker(if not home) |
items | items that are needed |
maxDistance | maximum distance from walker to giver |
pathType | defines the type of pathing to use |
pathTag | additional pathing parameter |
Implements CityBuilderCore.IGiverPathfinder.
|
inline |
Implements CityBuilderCore.IGiverPathfinder.
|
inline |
attempts to find a receiver and a path to it for an item a walker wants to deliver
building | home building of the walker |
currentPoint | current point of the walker(if not home) |
items | items the walker is trying to get rid of |
maxDistance | maximum distance a receiver can be from the walker |
pathType | pathing type to use for the walking path |
pathTag | additional pathing paramater |
currentPriority | IItemReceiver.Priority of the building the walker is coming from, used to make sure an item is not delivered from one storage to another for example |
Implements CityBuilderCore.IReceiverPathfinder.
|
inline |
Implements CityBuilderCore.IReceiverPathfinder.
|
inline |
checks if there is a dispenser with the right key in the vicinity
key | key used to discern different types of dispensers(rock, tree, gold, ...) |
position | absolute world position of the retriever |
maxDistance | maximum distance between dispenser and retriever |
Implements CityBuilderCore.IItemsDispenserManager.
|
inline |
removes a previously added retriever so it can no longer be found be retrievers
dispenser | the dispenser to remove |
Implements CityBuilderCore.IItemsDispenserManager.
|
get |
storage that holds the items of the global storage
Implements CityBuilderCore.IGlobalStorage.