Drafts
Drafts are pieces used to create blueprints on the drafting table.
The draft consists of an image, a shape, and a list of input and output ports.
The draft shape consists of cells, and each cell can have inputs and outputs. A draft can have a shape of any complexity, but shapes that are too large may not fit on some canvases.
Drafts are individual for each player, and are added to the player using triggers.
Adding draft
Drafts can be added by implementing the IDraftsDescriptor
interface in CollectibleBehavior
.
The mod implements the "pomdrafts:draft" behavior, which adds a way to describe a draft.
{
"code": "...",
"behaviors": [
{
"name": "pomdrafts:draft",
"properties": {
"shape": [ "..." ],
"cells": {
"...": {
"outputs": {
"up": "CONNECTION_TYPE",
"left": "CONNECTION_TYPE",
"right": "CONNECTION_TYPE"
"down": "CONNECTION_TYPE"
},
"inputs": {
"up": "CONNECTION_TYPE"
"left": "CONNECTION_TYPE"
"right": "CONNECTION_TYPE"
"down": "CONNECTION_TYPE"
}
}
},
"texture": "...",
"color": "#RRGGBB",
"groups": [ "..." ]
}
}
],
...
}
Properties:
shape
- describes the shape of a draft, where each line in a list is a row, and each letter is a cell. If the letter is not in the list of cells, then it is considered as an empty space.cells
- a list of cell types, the key being the letter used in the shape. May haveinputs
/outputs
parameters describing the type of port on each side.texture
- path to the draft texture, the texture is stretched over the entire area of the shape.color
- cells color, white by default.groups
- used to group by sections in the drafting table.