equipment_grid

class EquipmentGridMixin(
equipment: list[EquipmentComponent] = NOTHING,
enable_logistics_while_moving: bool = True,
*,
extra_keys: dict[str, Any] | None = None,
)

Enables the entity to have an equipment grid.

enable_logistics_while_moving : bool

Whether or not to attempt to satisfy the logistic requests of this entity while it is in motion.

equipment : list[EquipmentComponent]

Serialized

This attribute is imported/exported from blueprint strings.

The equipment specification of this particular entity, defining what equipment is requested and where it should live in the equipment_grid.

Note

This construct specifies where items should live, but on it’s own it does nothing; you also need to request the items with item_requests in order for robots to actually try to fulfill the grid’s contents. Alternatively, you can use the helper methods add_equipment() and remove_equipment() which will take care of this book-keeping for you.

property equipment_grid

The equipment grid prototype of this entity. Contains metadata about the equipment grid properties associated with this particular entity. Returns None if this entity is not recognized by Draftsman. Read only; not exported.

add_equipment(
name: str,
position: Vector = (0, 0),
quality: 'normal' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'quality-unknown' = 'normal',
) None

Adds a piece of equipment with name at position, where position is an integer coordinate corresponding to the top-left tile of the placed equipment. Also update’s this entity’s item_requests to actually deliver the equipment items on construction.

Parameters:
name: str

The name of the equipment to place in the grid.

position: Vector = (0, 0)

The integer position with which to place this particular piece of equipment. Usually specified as a tuple.

quality: 'normal' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'quality-unknown' = 'normal'

The quality of the equipment to add.

remove_equipment(
name: str | None = None,
position: Vector | None = None,
quality: 'normal' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'quality-unknown' | None = None,
) None

Removes all equipment matching the passed in arguments. Providing just a name will remove all equipment with that name, regardless of position or quality - providing just a position will only remove the item that exists at that position, and so forth.

Every time equipment is removed, any item requests associated with it are also updated properly. If the item request has no items requested after the equipment has been removed, the item request is also removed by this method.

Parameters:
name: str | None = None

The name of the equipment to remove.

position: Vector | None = None

The top left coordinate of the position to remove the equipment from.

quality: 'normal' | 'uncommon' | 'rare' | 'epic' | 'legendary' | 'quality-unknown' | None = None

The quality of the equipment to remove.