@reis/seki
Version:
Seki – A modern javascript based Go board renderer and player, that is simple to use, extensible, compact and intuitive.
112 lines (96 loc) • 2.3 kB
JavaScript
import {stoneColors} from './stone.js'
import {markupTypes} from './markup.js'
import {setupTypes} from './setup.js'
import {scoreTypes} from './score.js'
import {gameTypes} from './game.js'
//The a character
export const charCodeA = 97
//Info properties map for general game properties
export const sgfGameInfoMap = {
//Record properties
FF: 'record.version',
CA: 'record.charset',
AP: 'record.generator',
US: 'record.transcriber',
//Source properties
SO: 'source.name',
CP: 'source.copyright',
//Game information
GM: 'game.type',
GN: 'game.name',
DT: 'game.date',
RE: 'game.result',
ON: 'game.opening',
AN: 'game.annotator',
GC: 'game.description',
//Board information
SZ: 'board.size',
XL: 'board.cutOffLeft',
XR: 'board.cutOffRight',
XT: 'board.cutOffTop',
XB: 'board.cutOffBottom',
//Event information
EV: 'event.name',
PC: 'event.location',
RO: 'event.round',
//Rules
KM: 'rules.komi',
HA: 'rules.handicap',
RU: 'rules.ruleset',
TM: 'rules.time',
OT: 'rules.overtime',
TC: 'rules.numberOfPeriods', //Fox
TT: 'rules.timePerPeriod', //Fox
//Settings
ST: 'settings',
}
//Player info properties map
export const sgfPlayerInfoMap = {
PB: 'name',
PW: 'name',
BT: 'team',
WT: 'team',
BR: 'rank',
WR: 'rank',
}
//Stone colors
export const sgfStoneColors = {
[]: 'B',
[]: 'W',
}
//Game types
export const sgfGameTypes = {
[]: 1,
[]: 2,
[]: 3,
[]: 4,
[]: 6,
[]: 7,
[]: 8,
[]: 0,
}
//Markup types
export const sgfMarkupTypes = {
[]: 'LB',
[]: 'LN',
[]: 'AR',
[]: 'SL',
[]: 'SQ',
[]: 'CR',
[]: 'TR',
[]: 'MA',
[]: 'MH',
[]: 'MS',
}
//Setup types
export const sgfSetupTypes = {
[]: 'AB',
[]: 'AW',
[]: 'AE',
}
//Scoring types
export const sgfScoreTypes = {
[]: 'TB',
[]: 'TW',
[]: 'TN',
}