all repos — emchess @ e3439f4fd1351a66738e364bb3c2a16038ca6e6a

src/board/pieces.js (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
// One fixed glyph per piece type, so a pawn always reads as a pawn.
const SETS = {
    kingdom: {
        id: "kingdom",
        name: "Kingdom",
        traditional: false,
        glyphs: { k: "🤴", q: "👸", b: "🧙", n: "🏇", r: "🏰", p: "🧑" },
    },
    forest: {
        id: "forest",
        name: "Forest",
        traditional: false,
        glyphs: { k: "🦁", q: "🦊", b: "🦉", n: "🦌", r: "🌳", p: "🐿️" },
    },
    gothic: {
        id: "gothic",
        name: "Gothic",
        traditional: false,
        glyphs: { k: "🧛", q: "🧛‍♀️", b: "🧙‍♂️", n: "🐺", r: "🏰", p: "🧟" },
    },
    minimal: {
        id: "minimal",
        name: "Minimal",
        traditional: true,
        // Color comes from the .w / .b classes, not the glyph.
        glyphs: { k: "♚", q: "♛", b: "♝", n: "♞", r: "♜", p: "♟" },
    },
};
export const PIECE_SETS = Object.values(SETS);
export function getSet(id) {
    return SETS[id] ?? SETS.kingdom;
}