printer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlgebraicPrinter

type AlgebraicPrinter struct{}

func (AlgebraicPrinter) PrintAction

func (p AlgebraicPrinter) PrintAction(gameStep core.GameStep, gameCharacteristics GameCharacteristics) (string, error)

func (AlgebraicPrinter) PrintGame

func (p AlgebraicPrinter) PrintGame(gameSteps []core.GameStep, gameCharacteristics GameCharacteristics) ([]string, error)

type CoordinatePrinter

type CoordinatePrinter struct{}

func (CoordinatePrinter) PrintAction

func (p CoordinatePrinter) PrintAction(gameStep core.GameStep, gameCharacteristics GameCharacteristics) (string, error)

func (CoordinatePrinter) PrintGame

func (p CoordinatePrinter) PrintGame(gameSteps []core.GameStep, gameCharacteristics GameCharacteristics) ([]string, error)

type DescriptivePrinter

type DescriptivePrinter struct{}

func (DescriptivePrinter) PrintAction

func (p DescriptivePrinter) PrintAction(gameStep core.GameStep, gameCharacteristics GameCharacteristics) (string, error)

func (DescriptivePrinter) PrintGame

func (p DescriptivePrinter) PrintGame(gameSteps []core.GameStep, gameCharacteristics GameCharacteristics) ([]string, error)

type GameCharacteristics

type GameCharacteristics struct {
	// contains filtered or unexported fields
}

func FigurineCharacteristics

func FigurineCharacteristics() GameCharacteristics

FigurineCharacteristics returns GameCharacteristics for Figurine Algebraic Notation: SAN with unicode chess symbols instead of piece letters.

func SANCharacteristics

func SANCharacteristics() GameCharacteristics

SANCharacteristics returns GameCharacteristics matching Standard Algebraic Notation, which differs from the printer defaults in the castling and checkmate symbols.

type ICCFPrinter

type ICCFPrinter struct{}

func (ICCFPrinter) PrintAction

func (p ICCFPrinter) PrintAction(gameStep core.GameStep, gameCharacteristics GameCharacteristics) (string, error)

func (ICCFPrinter) PrintGame

func (p ICCFPrinter) PrintGame(gameSteps []core.GameStep, gameCharacteristics GameCharacteristics) ([]string, error)

type NotationPrinter

type NotationPrinter interface {
	PrintGame(gameSteps []core.GameStep, gameCharacteristics GameCharacteristics) ([]string, error)
	PrintAction(gameStep core.GameStep, gameCharacteristics GameCharacteristics) (string, error)
}

type PGNPrinter

type PGNPrinter struct {
	// Metadata holds tag pairs to render in the tag section (e.g. from a parsed
	// PGN's headers). Seven Tag Roster keys missing from it get "?" placeholders.
	Metadata map[string]string
}

PGNPrinter renders a game as a PGN document: a tag-pair section (the Seven Tag Roster plus any extra metadata) followed by the movetext with move numbers, comments, the result marker, and lines wrapped at 80 columns.

func (PGNPrinter) PrintAction

func (p PGNPrinter) PrintAction(gameStep core.GameStep, gameCharacteristics GameCharacteristics) (string, error)

PrintAction renders a single action in SAN (the movetext language of PGN).

func (PGNPrinter) PrintGame

func (p PGNPrinter) PrintGame(gameSteps []core.GameStep, gameCharacteristics GameCharacteristics) ([]string, error)

PrintGame renders the full PGN document as lines: the tag section, a blank line, then the movetext wrapped at 80 columns.

type SmithPrinter

type SmithPrinter struct{}

func (SmithPrinter) PrintAction

func (p SmithPrinter) PrintAction(gameStep core.GameStep, gameCharacteristics GameCharacteristics) (string, error)

func (SmithPrinter) PrintGame

func (p SmithPrinter) PrintGame(gameSteps []core.GameStep, gameCharacteristics GameCharacteristics) ([]string, error)

Jump to

Keyboard shortcuts

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