Exemplo n.º 1
0
var Variants = map[string]Variant{}

var OrderedVariants = []Variant{
	Variant{
		Name:  Classical,
		Start: classical.Start,
		Blank: classical.Blank,
		BlankStart: func() (result *state.State, err error) {
			result = classical.Blank(classical.Phase(1900, cla.Fall, cla.Adjustment))
			return
		},
		ParseOrders: orders.ParseAll,
		ParseOrder:  orders.Parse,
		Graph:       start.Graph(),
		Phase:       classical.Phase,
		OrderTypes:  orders.OrderTypes(),
		Nations:     cla.Nations,
		PhaseTypes:  cla.PhaseTypes,
		Seasons:     cla.Seasons,
		UnitTypes:   cla.UnitTypes,
	},
	Variant{
		Name:  FleetRome,
		Graph: start.Graph(),
		Start: func() (result *state.State, err error) {
			if result, err = classical.Start(); err != nil {
				return
			}
			result.RemoveUnit(dip.Province("rom"))
			if err = result.SetUnit(dip.Province("rom"), dip.Unit{
				Type:   cla.Fleet,
Exemplo n.º 2
0
var classicalVariant = &Variant{
	Id:         ClassicalString,
	Name:       "Classical",
	PhaseTypes: cla.PhaseTypes,
	Nations:    cla.Nations,
	Colors: map[dip.Nation]string{
		cla.Austria: "#afe773",
		cla.England: "#483c6c",
		cla.France:  "#5693aa",
		cla.Germany: "#ff8b66",
		cla.Italy:   "#1b6c61",
		cla.Russia:  "#8d5e68",
		cla.Turkey:  "#ffdb66",
	},
	OrderTypes:       claOrders.OrderTypes(),
	UnitTypes:        cla.UnitTypes,
	Graph:            start.Graph(),
	SupplyCenters:    start.SCs(),
	OrderTypeAbbrevs: map[string]dip.OrderType{},
	NationAbbrevs:    map[string]dip.Nation{},
	UnitTypeAbbrevs:  map[string]dip.UnitType{},
	Seasons:          cla.Seasons,
}

func init() {
	for _, orderType := range classicalVariant.OrderTypes {
		i := 1
		for {
			if _, found := classicalVariant.OrderTypeAbbrevs[string(orderType)[0:i]]; !found {
				break