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 specified Resource.

Parameters:

resource (Resource) – The Resource being used.

Methods

__init__(resource, entity)

Create a UsingResourceState for the specified Resource.

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