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
UsingResourceState
for the specifiedResource
.
Methods
__init__
(resource, entity)Create a
UsingResourceState
for 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
entity
The entity this state belongs to.
type_id
resource
name
completed
switch_to