sgf

package
v0.0.0-...-1a98718 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const Annotator = "AN"
View Source
const Boardsize = "SZ"
View Source
const Charset = "CA"
View Source
const Comment = "C"
View Source
const Copyright = "CP"
View Source
const Date = "DT"
View Source
const Event = "EV"
View Source
const GameComment = "GC"
View Source
const GameName = "GN"
View Source
const Handicap = "HA"
View Source
const Komi = "KM"
View Source
const Opening = "ON"
View Source
const Overtime = "OT"
View Source
const Place = "PC"
View Source
const PlayerBlackName = "PB"
View Source
const PlayerBlackRank = "BR"
View Source
const PlayerBlackTeam = "BT"
View Source
const PlayerWhiteName = "PW"
View Source
const PlayerWhiteRank = "WR"
View Source
const PlayerWhiteTeam = "WT"
View Source
const Result = "RE"
View Source
const Round = "RO"
View Source
const Rules = "RU"
View Source
const Source = "SO"
View Source
const TimeLimits = "TM"
View Source
const User = "US"

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	GameInfo GameInfo
	GameTree *Node
	Errors   []error
}

func (*Game) AddError

func (sgf *Game) AddError(msg string)

func (*Game) AddInfo

func (sgf *Game) AddInfo(prop Property)

func (Game) GameTreeString

func (sgf Game) GameTreeString() string

func (*Game) GetInfo

func (sgf *Game) GetInfo(name string) (value string, ok bool)

func (Game) NodeCount

func (sgf Game) NodeCount() int

func (Game) NthNode

func (sgf Game) NthNode(n int) (node *Node, err error)

func (Game) String

func (sgf Game) String() string

type GameInfo

type GameInfo map[string]string

func (GameInfo) FromJson

func (gi GameInfo) FromJson(json_str string) (GameInfo, error)

func (GameInfo) String

func (gi GameInfo) String() string

func (GameInfo) ToJson

func (gi GameInfo) ToJson() ([]byte, error)

type Node

type Node struct {
	Point      Property
	Properties []Property
	Variations []*Node
	Next       *Node
}

func (*Node) AddProperty

func (node *Node) AddProperty(prop Property)

func (*Node) NewNode

func (node *Node) NewNode() *Node

func (*Node) NewVariation

func (n *Node) NewVariation() *Node

func (Node) String

func (node Node) String() string

type Point

type Point struct {
	X rune
	Y rune
}

func (Point) String

func (point Point) String() string

type Property

type Property struct {
	Name  string
	Value string
}

func (Property) String

func (p Property) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL