classical

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: GPL-3.0 Imports: 16 Imported by: 1

Documentation

Overview

Code generated by go-bindata. (@generated) DO NOT EDIT. sources: svg/army.svg svg/fleet.svg svg/map.svg

Index

Constants

This section is empty.

Variables

View Source
var ClassicalVariant = common.Variant{
	Name:  "Classical",
	Start: Start,
	Blank: Blank,
	BlankStart: func() (result *state.State, err error) {
		result = Blank(NewPhase(1900, godip.Fall, godip.Adjustment))
		return
	},
	Parser:     Parser,
	Graph:      func() godip.Graph { return start.Graph() },
	Phase:      NewPhase,
	Nations:    Nations,
	PhaseTypes: PhaseTypes,
	Seasons:    Seasons,
	UnitTypes:  UnitTypes,
	SoloWinner: common.SCCountWinner(18),
	SVGMap: func() ([]byte, error) {
		return Asset("svg/map.svg")
	},
	SVGVersion: "5",
	SVGUnits: map[godip.UnitType]func() ([]byte, error){
		godip.Army: func() ([]byte, error) {
			return Asset("svg/army.svg")
		},
		godip.Fleet: func() ([]byte, error) {
			return Asset("svg/fleet.svg")
		},
	},
	CreatedBy:   "Allan B. Calhamer",
	Version:     "",
	Description: "The original game of Diplomacy.",
	Rules:       "The first to 18 supply centers is the winner. See the Wikibooks article for how to play: https://en.wikibooks.org/wiki/Diplomacy/Rules",
}

Functions

func AdjustSCs

func AdjustSCs(phase *phase.Phase) bool

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func BackupRule

func BackupRule(state godip.State, deps []godip.Province) (err error)

func Blank

func Blank(phase godip.Phase) *state.State

func DATCNation

func DATCNation(typ string) (result godip.Nation, err error)

func DATCOrder

func DATCOrder(text string) (province godip.Province, order godip.Adjudicator, err error)

func DATCPhase

func DATCPhase(season string, year int, typ string) (result godip.Phase, err error)

func DATCProvince

func DATCProvince(n string) (result godip.Province, err error)

func DATCUnitType

func DATCUnitType(typ string) (result godip.UnitType, err error)

func MustAsset

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

func NewPhase

func NewPhase(year int, season godip.Season, typ godip.PhaseType) godip.Phase

func RestoreAsset

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func Start

func Start() (result *state.State, err error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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