deck

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MaxValuesUpd

func MaxValuesUpd(troopix int, values []int) (updValues []int, max bool)

MaxValuesUpd update the max value list with a card. #values

Types

type Deck

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

Deck contain all information of unknown cards. That includes decks and the hand of the opponent. It also tracks cards returned to deck when scout is played.

func NewDeck

func NewDeck() (deck *Deck)

NewDeck creates a new deck.

func (*Deck) BotDrawNo

func (deck *Deck) BotDrawNo(isFirst bool) (no int)

BotDrawNo calculate the bots number of the unknown cards.

func (*Deck) DeckTacNo

func (d *Deck) DeckTacNo() int

DeckTacNo returns current the tactic card deck size.

func (*Deck) DeckTroopNo

func (d *Deck) DeckTroopNo() int

DeckTroopNo returns the current troop deck size.

func (*Deck) InitRemoveCards

func (d *Deck) InitRemoveCards(cardixs []int)

InitRemoveCard removes a cards from decks. Warning does not include scout return it should be used for init. moves.

func (*Deck) MaxValues

func (d *Deck) MaxValues() (values []int)

MaxValues returns the 4 max value a deck contain.

func (*Deck) OppDraw

func (d *Deck) OppDraw(troop bool)

OppDraw update the deck with a card drawn by the opponent of the bot.

func (*Deck) OppDrawNo

func (deck *Deck) OppDrawNo(isFirst bool) (no int)

OppDrawNo calculate the opponent number of unknown cards.

func (*Deck) OppHand

func (deck *Deck) OppHand() []int

OppHand returns the opponent hand it is copy.

func (*Deck) OppKnowns

func (deck *Deck) OppKnowns() (noTacs, noTroops int, handCardixs []int)

func (*Deck) OppPlay

func (d *Deck) OppPlay(cardix int)

OppPlay update the deck with a card played by the opponent of the bot.

func (*Deck) OppScoutReturn

func (d *Deck) OppScoutReturn(troops int, tacs int)

OppScoutReturn update the deck with the opponent scout return move.

func (*Deck) OppSetInitHand

func (d *Deck) OppSetInitHand(troops int, tacs int)

OppSetInitHand sets the opponents initial hand. Only used when restarting a old game. The deck initialize with 7 troops card.

func (*Deck) OppTacNo

func (deck *Deck) OppTacNo() int

func (*Deck) OppTroopNo

func (deck *Deck) OppTroopNo() int

func (*Deck) PlayDraw

func (d *Deck) PlayDraw(cardix int)

PlayDraw updates the deck with a card drawn by the bot.

func (*Deck) PlayScoutReturn

func (d *Deck) PlayScoutReturn(troops []int, tacs []int)

PlayScoutReturn registor a scout return move. Cards are delt from the back.

func (*Deck) Reset

func (d *Deck) Reset()

Reset reset the deck to its initial state.

func (*Deck) ScoutReturnTacPeek

func (deck *Deck) ScoutReturnTacPeek() int

func (*Deck) ScoutReturnTroopPeek

func (deck *Deck) ScoutReturnTroopPeek() int

func (*Deck) Tacs

func (deck *Deck) Tacs() map[int]bool

Tacs returns a all tactic cards in the deck.

func (*Deck) TfScoutReturnMoveTacs

func (deck *Deck) TfScoutReturnMoveTacs() []int

func (*Deck) TfScoutReturnMoveTroops

func (deck *Deck) TfScoutReturnMoveTroops() []int

func (*Deck) Troops

func (deck *Deck) Troops() map[int]bool

Troops returns a all troops in the deck.

Jump to

Keyboard shortcuts

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