factoriax.playground.editor.slot_display#
The slot layout that the editor draws for each machine.
The module gives the number of slots for each machine kind. It also gives the part that each slot has in the recipe, with the label and the color of the badge for that part.
None of this reaches the simulation. A level records the contents of a machine
by item, and records no slot. A slot is therefore a view that the editor
draws, and factoriax.playground.editor.state builds that view from the
items.
factoriax.engine.levels gives each item a slot by its own rules, and
never reads the layout here. The meaning of each part is with
SlotRole.
Module Attributes
Slot count per machine, indexed by |
|
Slot count of the widest machine. |
|
Slot roles per machine, shape |
|
Badge text per |
|
Badge fill colour per |
- factoriax.playground.editor.slot_display.MACHINE_NUM_SLOTS = array([0, 1, 1, 1, 3, 0, 0, 3, 2, 1, 2], dtype=int32)#
Slot count per machine, indexed by
Machinevalue. Shape(len(Machine),), numpy int32. Zero for a machine the editor shows no slots for, includingARM, which carries an item in transit rather than storing one.
- factoriax.playground.editor.slot_display.MACHINE_SLOT_ROLES = array([[0, 0, 0], [2, 0, 0], [3, 0, 0], [3, 0, 0], [1, 1, 2], [0, 0, 0], [0, 0, 0], [1, 1, 2], [1, 1, 0], [3, 0, 0], [3, 3, 0]], dtype=int32)#
Slot roles per machine, shape
(len(Machine), MAX_MACHINE_INVENTORY_SLOTS), numpy int32 holdingSlotRolevalues. Columns past a machine’s slot count areSlotRole.NONE, marking a slot that does not exist.
- factoriax.playground.editor.slot_display.MAX_MACHINE_INVENTORY_SLOTS: int = 3#
Slot count of the widest machine. Fixes the row width of
MACHINE_SLOT_ROLESand of the editor’s per-tile slot arrays, which are rectangular and so pad every machine out to this many slots.