Reference · Pipes, rules and solving
GuidePiecetype
One piece of the guide.
Import it
import type { GuidePiece } from "@johnmorrisdotca/suido";
Definition
type GuidePiece = {
id: string;
group: PieceGroup;
name: string;
text: string;
layout: Layout;
water: boolean;
facings: number | null;
};
Members
| Name | Type | Description |
|---|---|---|
id | string | Its name in the address of a page or the name of a picture: lower case words joined with hyphens. |
group | PieceGroup | |
name | string | Its name, in English. |
text | string | What it is and what it does, in a sentence or two, in English. |
layout | Layout | A board with the piece on it. Drawn as it is, so a pump the water leaves from shows its water. |
water | boolean | Whether the picture shows the water. |
facings | number | null | How many ways it faces when it is turned: 1, 2 or 4; null for a thing that is not turned. |
Examples
import type { GuidePiece } from "@johnmorrisdotca/suido";
import { SUIDO_PIECE_GUIDE } from "@johnmorrisdotca/suido";
const value: GuidePiece = SUIDO_PIECE_GUIDE[0];
console.log(value);{
id: 'ground',
group: 'turn',
name: 'Ground',
text: 'Bare ground, with nothing on it. Only boards whose water need not reach every piece have it, and it is never turned.',
layout: {
width: 1,
height: 1,
kind: 'network',
wrap: false,
cells: [ 0 ],
sources: [],
drains: []
},
water: false,
facings: null
}What it prints (run when this page was built)