Documentation ¶
Index ¶
- type Cache
- func (c *Cache) CopyWithOutHand(outTroop card.Troop, playix int) (copyCache *Cache)
- func (c *Cache) OnlyDeckSet() (set map[card.Troop]bool)
- func (c *Cache) Set(playerix int) (set map[card.Troop]bool)
- func (c *Cache) SortStrs(playix int) (strs [][]card.Troop)
- func (c *Cache) Sum(playerix, color, no int) (sum int, isOk bool)
- func (c *Cache) TargetSum(playerix, color, no, targetSum int) (res *TargetResult)
- func (c *Cache) Troops(playerix, color, no int) (troops []card.Troop, isOk bool)
- type TargetResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { SrcDeckTroops []card.Troop SrcHandTroops [2][]card.Troop SrcDrawNos [2]int // contains filtered or unexported fields }
Cache the hand deck troops cache.
func (*Cache) CopyWithOutHand ¶
CopyWithOutHand makes a copy with out one troop on the hand.
func (*Cache) OnlyDeckSet ¶
OnlyDeckSet returns the deck set with out any hand troos.
func (*Cache) TargetSum ¶
func (c *Cache) TargetSum(playerix, color, no, targetSum int) (res *TargetResult)
TargetSum returns the result of the target sum calculation.
type TargetResult ¶
type TargetResult struct { IsPossibel bool IsMade bool ValidDeckTroops []card.Troop ValidHandTroops []card.Troop NewSum int NewNo int }
TargetResult the struct holds the result of a target sum calculation.
func (*TargetResult) Equal ¶
func (t *TargetResult) Equal(o *TargetResult) (isEqual bool)
Equal compares to target results.
Click to show internal directories.
Click to hide internal directories.