Documentation ¶
Index ¶
- Constants
- Variables
- func Asset(name string) ([]byte, error)
- func AssetDir(name string) ([]string, error)
- func AssetInfo(name string) (os.FileInfo, error)
- func AssetNames() []string
- func MustAsset(name string) []byte
- func Phase(year int, season godip.Season, typ godip.PhaseType) godip.Phase
- func RestoreAsset(dir, name string) error
- func RestoreAssets(dir, name string) error
- func SengokuBlank(phase godip.Phase) *state.State
- func SengokuGraph() *graph.Graph
- func SengokuStart() (result *state.State, err error)
Constants ¶
Variables ¶
var SVGFlags = map[godip.Nation]func() ([]byte, error){ Takeda: func() ([]byte, error) { return Asset("svg/takeda.svg") }, Mori: func() ([]byte, error) { return Asset("svg/mori.svg") }, Chosokabe: func() ([]byte, error) { return Asset("svg/chosokabe.svg") }, Hojo: func() ([]byte, error) { return Asset("svg/hojo.svg") }, Oda: func() ([]byte, error) { return Asset("svg/oda.svg") }, Shimazu: func() ([]byte, error) { return Asset("svg/shimazu.svg") }, Uesugi: func() ([]byte, error) { return Asset("svg/uesugi.svg") }, }
var SengokuVariant = common.Variant{ Name: "Sengoku", NationColors: map[godip.Nation]string{ Takeda: "#9A0000", Mori: "#F6685B", Chosokabe: "#6A9B4E", Hojo: "#2E6085", Oda: "#E6C83C", Shimazu: "#404040", Uesugi: "#C67931", }, Graph: func() godip.Graph { return SengokuGraph() }, Start: SengokuStart, Blank: SengokuBlank, Phase: Phase, Parser: hundred.BuildAnywhereParser, Nations: Nations, PhaseTypes: classical.PhaseTypes, Seasons: classical.Seasons, UnitTypes: classical.UnitTypes, SoloWinner: common.SCCountWinner(25), SoloSCCount: func(*state.State) int { return 25 }, ProvinceLongNames: provinceLongNames, SVGMap: func() ([]byte, error) { return Asset("svg/sengokumap.svg") }, SVGVersion: "4", 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") }, }, SVGFlags: SVGFlags, CreatedBy: "Benjamin Hester", Version: "1.0", Description: "Battle it out during the Sengoku (warring states) period of 16th Century Japan which collapsed the feudal system under the Ashikaga Shogunate. Select one of seven clans to become the new Shogun.", Rules: `The first to 25 Supply Centers (SC) is the winner. Units may be built at any owned SC. There are 6 bridges connecting provinces (dashed lines) across the water. These represent a direct connection between the two provinces separated by water and can be used by both armies and fleets. There is a neutral army which will only ever issue orders to hold, disband or rebuild armies.`, }
Functions ¶
func Asset ¶
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 ¶
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 ¶
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 MustAsset ¶
MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.
func RestoreAsset ¶
RestoreAsset restores an asset under the given directory
func RestoreAssets ¶
RestoreAssets restores an asset under the given directory recursively
func SengokuGraph ¶
func SengokuStart ¶
Types ¶
This section is empty.