twentytwenty

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/twentytwentymap.svg

Index

Constants

View Source
const (
	Brazil      godip.Nation = "Brazil"
	Canada      godip.Nation = "Canada"
	Australia   godip.Nation = "Australia"
	Italy       godip.Nation = "Italy"
	USA         godip.Nation = "USA"
	Kenya       godip.Nation = "Kenya"
	Egypt       godip.Nation = "Egypt"
	Thailand    godip.Nation = "Thailand"
	Turkey      godip.Nation = "Turkey"
	SouthAfrica godip.Nation = "South Africa"
	India       godip.Nation = "India"
	Russia      godip.Nation = "Russia"
	Pakistan    godip.Nation = "Pakistan"
	China       godip.Nation = "China"
	UK          godip.Nation = "UK"
	Japan       godip.Nation = "Japan"
	Germany     godip.Nation = "Germany"
	Argentina   godip.Nation = "Argentina"
	Nigeria     godip.Nation = "Nigeria"
	Spain       godip.Nation = "Spain"
)

Variables

View Source
var TwentyTwentyVariant = common.Variant{
	Name:       "Twenty Twenty",
	Graph:      func() godip.Graph { return TwentyTwentyGraph() },
	Start:      TwentyTwentyStart,
	Blank:      TwentyTwentyBlank,
	Phase:      Phase,
	Parser:     BuildAnyHomeCenterParser,
	Nations:    Nations,
	PhaseTypes: classical.PhaseTypes,
	Seasons:    classical.Seasons,
	UnitTypes:  classical.UnitTypes,
	SoloWinner: TwentyTwentyWinner,
	SVGMap: func() ([]byte, error) {
		return Asset("svg/twentytwentymap.svg")
	},
	SVGVersion: "6",
	SVGUnits: map[godip.UnitType]func() ([]byte, error){
		godip.Army: func() ([]byte, error) {
			return classical.Asset("svg/army.svg")
		},
		godip.Fleet: func() ([]byte, error) {
			return classical.Asset("svg/fleet.svg")
		},
	},
	CreatedBy:   "TTTPPP",
	Version:     "1",
	Description: "Twenty nations compete to conquer the world by the year 2020.",
	Rules: "The rules are mostly standard. Nations may build in any captured " +
		"home centers (note - they may not build in captured neutral supply " +
		"centers). To win a nation needs to own more supply centers than any " +
		"opponent. In the first year they need 20 more supply centers than any " +
		"other player, but this target is reduced by 1 each year. So to win in " +
		"the year 2015 a player needs at least 6 more supply centers than any " +
		"other player, and in 2020 and beyond they need a lead of a single " +
		"supply center. Alternatively, if a player manages to get to 49 centers " +
		"(i.e. they own over half the map) then they automatically win. The " +
		"game can only be won in the adjustment phase at the end of a year. There " +
		"are six bridges connecting regions for armies (and fleets). These are " +
		"Anchorage-Vladivostok, New Orleans-Cuba, Cuba-Dominican Republic, " +
		"Ethiopia-Yemen, Korea-Nagisaki and Indonesia-Darwin. Thirteen regions " +
		"have multiple coasts. These are Whitehorse, Los Angeles, Mexico, " +
		"Colombia, Bordeaux, Milan, Rome, Finland, Bulgaria, Ankara, Iraq, " +
		"Mecca and Shanyang.",
}

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

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

func TwentyTwentyGraph

func TwentyTwentyGraph() *graph.Graph

func TwentyTwentyStart

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

func TwentyTwentyWinner

func TwentyTwentyWinner(s *state.State) godip.Nation

A function that declares a solo winner if a nation has over 49 SCs, or they lead by at least max(2020-year, 1) SCs.

Types

This section is empty.

Jump to

Keyboard shortcuts

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