datc

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NationParser

type NationParser func(nation string) (godip.Nation, error)

type NationalizedOrder

type NationalizedOrder struct {
	Order  godip.Adjudicator
	Nation godip.Nation
}

func (NationalizedOrder) String

func (self NationalizedOrder) String() string

type OrderParser

type OrderParser func(text string) (godip.Province, godip.Adjudicator, error)

type Parser

type Parser struct {
	Variant        string
	OrderParser    OrderParser
	PhaseParser    PhaseParser
	NationParser   NationParser
	UnitTypeParser UnitTypeParser
	ProvinceParser ProvinceParser
}

func (Parser) Parse

func (self Parser) Parse(r io.Reader, handler StatePairHandler) (err error)

type PhaseParser

type PhaseParser func(season string, year int, typ string) (godip.Phase, error)

type ProvinceParser

type ProvinceParser func(prov string) (godip.Province, error)

type State

type State struct {
	SCs              map[godip.Province]godip.Nation
	Units            map[godip.Province]godip.Unit
	Dislodgeds       map[godip.Province]godip.Unit
	Orders           map[godip.Province]NationalizedOrder
	FailedOrders     map[godip.Province]NationalizedOrder
	SuccessfulOrders map[godip.Province]NationalizedOrder
	Phase            godip.Phase
}

type StatePair

type StatePair struct {
	Case   string
	Before *State
	After  *State
}

type StatePairHandler

type StatePairHandler func(states *StatePair)

type UnitTypeParser

type UnitTypeParser func(typ string) (godip.UnitType, error)

Jump to

Keyboard shortcuts

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