datasim.UsingResourceState¶
- class datasim.UsingResourceState(resource: Resource, entity: Entity)¶
State in which an Entity is using a
Resource.- __init__(resource: Resource, entity: Entity)¶
Create a
UsingResourceStatefor the specifiedResource.
Methods
__init__(resource, entity)Create a
UsingResourceStatefor the specifiedResource.on_enter()Implement this function to have the state execute any behavior for its entity when it enters this state.
on_leave()Implement this function to have the state execute any behavior for its entity when it leaves this state.
tick()Use the resource for one tick.
Attributes
entityThe entity this state belongs to.
type_idresourcenamecompletedswitch_to