ClassicCityBuilderKit 1.8.8
|
houses TownWalkers and stores food and wood
items are filled by the inhabitants or peddlers that work in a market that is connected via road
food is taken by by walkers to restore their food value
wood is periodically consumed by the component, as long as there is any walkers can restore their warmth value when they visit the house
the home also periodically spawns walkers up to its capacity
Classes | |
class | TomeHomeData |
Public Member Functions | |
override void | InitializeComponent () |
initialization is performed when the building is placed or loaded use to create references, register traits, ... | |
override void | OnReplacing (IBuilding replacement) |
called when a component gets replaced use to transfer resources, replace references | |
override void | TerminateComponent () |
termination is performed when the building is destroyed use to deregister traits, remove references from other systems | |
override void | SuspendComponent () |
temporarily stops the component from working | |
void | AddInhabitant (TownWalker walker) |
void | RemoveInhabitant (TownWalker walker) |
bool | Eat () |
bool | Warm () |
IEnumerable< Item > | GetRecipientItems () |
use this to check which items the recipient needs | |
IEnumerable< ItemQuantity > | GetRecipientItemQuantities () |
checks how much of every needed item the recipient currently has | |
void | FillRecipient (ItemStorage itemStorage) |
passes a storage to the recipient which will take any item from it that it needs | |
override string | GetDebugText () |
returns text that gets displayed for debugging in the scene editor | |
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.BuildingComponent | |
virtual void | SetupComponent () |
only called when the building is originally placed, before Initialize | |
virtual void | OnMoving () |
called when the building is about to be moved can be used to remove/deregister stuff from the old position | |
virtual void | OnMoved (Vector2Int oldPoint, BuildingRotation oldRotation) |
called after a building has been moved can be used to register things at the new position | |
virtual void | ResumeComponent () |
resumes work in the component after SuspendComponent has been called | |
virtual string | GetDescription () |
gets displayed in dialogs to show the component status to players | |
Public Attributes | |
ItemStorage | ItemStorage |
int | WalkerCapacity |
float | WalkerInterval |
float | WoodInterval |
BoolEvent | HasFoodChanged |
BoolEvent | HasWoodChanged |
Properties | |
override string | Key [get] |
unique key used to identify the component in save/load | |
BuildingComponentReference< TownHomeComponent > | Reference [get, set] |
List< TownWalker > | Inhabitants [get] |
int | RemainingWalkerCapacity [get] |
IItemContainer | ItemContainer [get] |
holds and manages the items for the owner | |
bool | HasFood [get] |
bool | HasWood [get] |
Properties inherited from CityBuilderCore.BuildingComponent | |
string | Key [get] |
unique key used to identify the component in save/load | |
IBuilding | Building [get, set] |
the building the component is attached to is set by the building in awake | |
Properties inherited from CityBuilderCore.IBuildingComponent | |
Properties inherited from CityBuilderCore.IBuildingTrait< TownHomeComponent > | |
BuildingComponentReference< T > | Reference [get, set] |
reference to the building trait, use when the building might be replaced and when the reference has to be saved | |
Properties inherited from CityBuilderCore.IItemOwner |
Additional Inherited Members | |
Protected Member Functions inherited from CityBuilderCore.BuildingComponent | |
T | getOther< T > () |
gets the first building component of the specified type on the same building | |
IEnumerable< T > | getOthers< T > () |
gets all building components of the specified type on the same building | |
BuildingComponentReference< T > | registerTrait< T > (T trait) |
registers the building component as a trait so it is globally accessible usually done in InitializeComponent | |
void | replaceTrait< T > (T trait, T replacement) |
replaces the reference a trait points to in the global manager done when a building is replaced(OnReplacing(IBuilding)) so the trait now points to the new component instead of the one that has been removed | |
void | deregisterTrait< T > (T trait) |
removes a previously registered trait usually when a building is removed which calls TerminateComponent | |
|
inline |
passes a storage to the recipient which will take any item from it that it needs
itemStorage | the storage the recipient will take from |
Implements CityBuilderCore.IItemRecipient.
|
inlinevirtual |
returns text that gets displayed for debugging in the scene editor
Reimplemented from CityBuilderCore.BuildingComponent.
IEnumerable< ItemQuantity > CityBuilderTown.TownHomeComponent.GetRecipientItemQuantities | ( | ) |
checks how much of every needed item the recipient currently has
Implements CityBuilderCore.IItemRecipient.
|
inline |
use this to check which items the recipient needs
Implements CityBuilderCore.IItemRecipient.
|
inlinevirtual |
initialization is performed when the building is placed or loaded
use to create references, register traits, ...
Reimplemented from CityBuilderCore.BuildingComponent.
|
inlinevirtual |
deserializes the serialized json data and loads the data as its new state
json |
Reimplemented from CityBuilderCore.BuildingComponent.
|
inlinevirtual |
called when a component gets replaced
use to transfer resources, replace references
replacement |
Reimplemented from CityBuilderCore.BuildingComponent.
|
inlinevirtual |
serializes the objects state(usually to json) and returns it
Reimplemented from CityBuilderCore.BuildingComponent.
|
inlinevirtual |
temporarily stops the component from working
Reimplemented from CityBuilderCore.BuildingComponent.
|
inlinevirtual |
termination is performed when the building is destroyed
use to deregister traits, remove references from other systems
Reimplemented from CityBuilderCore.BuildingComponent.
|
get |
holds and manages the items for the owner
Implements CityBuilderCore.IItemOwner.
|
get |
unique key used to identify the component in save/load
Implements CityBuilderCore.IBuildingComponent.