Skip to content

Components

Bases: PyTreeNode

Base class for all components in the game. Components are used to store the data of the entities in the game.

Bases: Component

Flags an entity as directional, and provides the direction attribute

The direction the entity: 0 = east, 1 = south, 2 = west, 3 = north

Bases: Component

Flags an entity as having a colour, and provides the colour attribute

The colour of the object for rendering.

Bases: Component

Flags an entity as having a sprite, and provides the sprite attribute. The sprite is used to render the entity in the game.

Bases: Component

Flags an entity as having a tag, and provides the tag attribute. The tag is used to identify the type of the entity in the observations.

The tag of the component, used to identify the type of the component in observations.categorical

Bases: Component

Flags an entity as a holder, and provides the pocket attribute. The pocket is used to store the id of the item in the pocket.

The id of the item in the pocket (0 if empty)

Bases: Component

Flags an entity as openable, and provides the requires and open attributes

Open is jnp.asarray(0) if the entity is closed and 1 if open.

The id of the item required to consume this item. If set, it must be > 0. If -1, the door is unlocked and does not require any key to open.

Bases: Component

Flags an entity as pickable, and provides the id attribute, which is used to identify the item in the inventory

The id of the item. If set, it must be >= 1.

Bases: Component

Flags an entity as positionable in the grid, and provides the position attribute

The (row, column) position of the entity in the grid as a JAX array, defaults to the discard pile (-1, -1)

Bases: Component

Flags an entity as stochastic, and provides the probability attribute

TODO
  • consider replace probability (Array) with a distrax.Distribution

The probability of receiving the reward, if reached.