cards

package
v0.0.0-...-0992052 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2017 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package cards contain the cards of battleline.

Index

Constants

View Source
const (
	//NOTroop is the number of troop cards.
	NOTroop = 60
	//NOTac is the number of tactic cards.
	NOTac = 10

	CTTroop  = 1
	CTMorale = 2
	CTEnv    = 3
	CTGuile  = 4

	COLNone   = 0
	COLGreen  = 1
	COLRed    = 2
	COLPurpel = 3
	COLYellow = 4
	COLBlue   = 5
	COLOrange = 6

	TCAlexander = 70
	TCDarius    = 69
	TC8         = 68
	TC123       = 67
	TCFog       = 66
	TCMud       = 65
	TCScout     = 64
	TCRedeploy  = 63
	TCDeserter  = 62
	TCTraitor   = 61
)

Variables

View Source
var (
	//Cards contain all battleline cards.
	Cards [NOTac + NOTroop + 1]Card // zero index is nil
	//FWedge the wedge formation.
	FWedge = Formation{
		Name:    "Wedge",
		Describ: "3(4) troops connected and same color. Like 2,1,3 or 3,2,1.",
		Value:   5,
	}
	//FPhalanx the phalanx formation.
	FPhalanx = Formation{
		Name:    "Phalanx",
		Describ: "3(4) troops same value. Like 10,10,10",
		Value:   4,
	}
	//FBattalion the battalion Order formation.
	FBattalion = Formation{
		Name:    "Battalion Order",
		Describ: "3(4) troops same color",
		Value:   3,
	}
	//FSkirmish the skirmish line formation.
	FSkirmish = Formation{
		Name:    "Skirmish Line",
		Describ: "3(4) troops connected. Like 2,1,3 or 3,1,2",
		Value:   2,
	}
	//FHost the jost formation.
	FHost = Formation{
		Name:    "Host",
		Describ: "Any troops",
		Value:   1,
	}
)

Functions

func IsEnv

func IsEnv(ix int) bool

IsEnv checks if card index is a environment tactic card. Mud or fog.

func IsGuile

func IsGuile(ix int) bool

IsGuile checks if card is guile card

func IsLeader

func IsLeader(ix int) bool

IsLeader checks if card is morale leader tactic card.

func IsMorale

func IsMorale(ix int) bool

IsMorale checks if a card index is morale tactic card. All jokers.

func IsTac

func IsTac(ix int) bool

IsTac checks if a card index is a tactic card.

func IsTroop

func IsTroop(ix int) bool

IsTroop checks if a cardix is troop card.

func MoraleMaxValue

func MoraleMaxValue(cardix int) int

MoraleMaxValue returns the maximum value a morale card can have.

Types

type Card

type Card interface {
	Name() string
	Describ() string
	Type() int
}

Card interface is the interface a battleline card.

func DrCard

func DrCard(ix int) (Card, bool)

DrCard returns the Card of the card index.

type Formation

type Formation struct {
	Name, Describ string
	Value         int
}

Formation a flag formation.

type Tactic

type Tactic struct {
	// contains filtered or unexported fields
}

Tactic is tactic card.

func DrTactic

func DrTactic(cardix int) (*Tactic, bool)

DrTactic returns the Tactic card of the card index.

func (Tactic) Describ

func (t Tactic) Describ() string

Describ is short text describtion of the Tactic card.

func (Tactic) Name

func (t Tactic) Name() string

Name is the name of the tactic card.

func (Tactic) Type

func (t Tactic) Type() int

Type is CTMorale, CTEnv or CTGuile for a tactic card.

type Troop

type Troop struct {
	// contains filtered or unexported fields
}

Troop is troop card.

func DrTroop

func DrTroop(cardix int) (*Troop, bool)

DrTroop returns the Troop card of the card index.

func (Troop) Color

func (t Troop) Color() int

Color is the color of the troop.

func (Troop) Describ

func (t Troop) Describ() string

Describ is a short describtion of the troop card.

func (Troop) Name

func (t Troop) Name() string

Name is the name of the troop card.

func (Troop) Type

func (t Troop) Type() int

Type is CTTroop

func (Troop) Value

func (t Troop) Value() int

Value is the value of the troop 1-10.

Jump to

Keyboard shortcuts

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