sengoku

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: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Takeda    godip.Nation = "Takeda"
	Mori      godip.Nation = "Mori"
	Chosokabe godip.Nation = "Chosokabe"
	Hojo      godip.Nation = "Hojo"
	Oda       godip.Nation = "Oda"
	Shimazu   godip.Nation = "Shimazu"
	Uesugi    godip.Nation = "Uesugi"
)

Variables

View Source
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")
	},
}
View Source
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

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 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 Phase

func Phase(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 SengokuBlank

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

func SengokuGraph

func SengokuGraph() *graph.Graph

func SengokuStart

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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