flag

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalcMaxRank

func CalcMaxRank(
	flagTroops []card.Troop,
	flagMorales []card.Morale,
	deckHandTroops *dht.Cache,
	playix int,
	formationSize int,
	isFog bool,
	targetRank, targetHostStr, targetBattStr int,
) (rank int, prob float64)

CalcMaxRank calculate the maximum rank a play may reach on a flag.

func HandAnalyze

func HandAnalyze(
	deckHandTroops *dht.Cache,
	botix int,
) (ana map[card.Troop][]*combi.Analysis)

HandAnalyze create a rank analysis of each troop on the hand. it assume no/ ignore enviroment cards, and targetSum = 0 this means can use Prob or Playables on combination Host

func MoraleTroopsSum

func MoraleTroopsSum(flagTroops []card.Troop, flagMorales []card.Morale) (sum int)

MoraleTroopsSum sums the strenght of troops and morales. Morales use the maxStrenght.

Types

type Analysis

type Analysis struct {
	Flagix           int
	TargetRank       int
	TargetSum        int
	BotMaxRank       int
	BotMaxSum        int
	OppFormationSize int
	BotFormationSize int
	FormationSize    int
	FlagValue        int
	IsTargetMade     bool
	IsLost           bool
	IsWin            bool
	IsNewFlag        bool
	IsPlayable       bool
	IsClaimed        bool
	Claimer          int
	IsFog            bool
	IsLoosingGame    bool
	RankAnas         []*combi.Analysis
	Flag             *game.Flag
	Playix           int
}

Analysis a analysis of the flag.

func NewAnalysis

func NewAnalysis(
	playix int,
	flag *game.Flag,
	deckHand *dht.Cache,
	flagix int) (fa *Analysis)

NewAnalysis create a flag analysis.

func (*Analysis) String

func (ana *Analysis) String() string

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(viewPos *game.ViewPos, posCards game.PosCards) (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 (deck *Deck) DeckTacNo() int

DeckTacNo returns current the tactic card deck size.

func (*Deck) DeckTroopNo

func (deck *Deck) DeckTroopNo() int

DeckTroopNo returns the current troop deck size.

func (*Deck) DrawNos

func (deck *Deck) DrawNos(drawFirst int) (nos [2]int)

DrawNos the number of draws from the deck per player.

func (*Deck) Envs

func (deck *Deck) Envs() []card.Env

Envs returns a all enviroment cards in the deck.

func (*Deck) Guiles

func (deck *Deck) Guiles() []card.Guile

Guiles returns a all guiles cards in the deck.

func (*Deck) MaxStrenghts

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

MaxStrenghts returns the 4 max strenghts a deck contain.

func (*Deck) Morales

func (deck *Deck) Morales() []card.Morale

Morales returns a all morales cards in the deck.

func (*Deck) OppDrawNo

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

OppDrawNo calculate the opponent number of unknown cards.

func (*Deck) OppHandTacNo

func (deck *Deck) OppHandTacNo() int

OppHandTacNo the opponets number of hand tactic cards.

func (*Deck) OppHandTroopsNo

func (deck *Deck) OppHandTroopsNo() int

OppHandTroopsNo the opponets number of hand troops cards.

func (*Deck) ScoutReturnTacPeek

func (deck *Deck) ScoutReturnTacPeek() card.Card

ScoutReturnTacPeek returns the next tactic card in the deck if it is known.

func (*Deck) ScoutReturnTroopPeek

func (deck *Deck) ScoutReturnTroopPeek() card.Card

ScoutReturnTroopPeek returns the next troop in the deck if its known.

func (*Deck) Tacs

func (deck *Deck) Tacs() []card.Card

Tacs returns the tactic cards in the deck. WARNING adds the tactic card together.

func (*Deck) Troops

func (deck *Deck) Troops() []card.Troop

Troops returns a all troops in the deck.

type TfAna

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

TfAna tensor flow analysis

func NewTfAnalysis

func NewTfAnalysis(
	playix int,
	flag *game.Flag,
	deckHandTroops *dht.Cache,
	flagix int) (tfa *TfAna)

NewTfAnalysis create a tensor flow flag analysis.

func (*TfAna) MachineFloats

func (tfa *TfAna) MachineFloats() (floats [19]float32)

func (*TfAna) MachineFormat

func (tfa *TfAna) MachineFormat() (txt string)

MachineFormat creates a tensor flow string.

func (*TfAna) String

func (tfa *TfAna) String() (txt string)

Jump to

Keyboard shortcuts

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