Documentation
¶
Index ¶
- Constants
- Variables
- type Battle
- type Board
- type Builder
- func (b *Builder) Create(options *bg.BoardGameOptions) (bg.BoardGame, error)
- func (b *Builder) CreateWithBGN(options *bg.BoardGameOptions) (bg.BoardGameWithBGN, error)
- func (b *Builder) Info() *bg.BoardGameInfo
- func (b *Builder) Key() string
- func (b *Builder) Load(game *bgn.Game) (bg.BoardGameWithBGN, error)
- type MoveUnitActionDetails
- type StategoSnapshotData
- type Stratego
- type StrategoMoreInfo
- type StrategoMoreOptions
- type SwitchUnitsActionDetails
- type Unit
Constants ¶
View Source
const ( BoardSize = 10 QuickBattleBoardSize = 8 )
View Source
const ( ActionSwitchUnits = "SwitchUnits" ActionMoveUnit = "MoveUnit" ActionToggleReady = "ToggleReady" )
Action types
View Source
const ( VariantClassic = "Classic" // normal Stratego VariantQuickBattle = "QuickBattle" // 8x8 quick play Stratego )
Stratego Variants
Variables ¶
View Source
var UnitTyes = []string{flag, bomb, spy, scout, miner, sergeant, lieutenant, captain, major, colonel, general, marshal}
UnitTyes ordered in ascending order by battle winner
Functions ¶
This section is empty.
Types ¶
type Battle ¶ added in v1.1.0
type Battle struct { MoveUnitActionDetails AttackingUnit, AttackedUnit Unit WinningTeam string }
type Builder ¶
type Builder struct{}
func (*Builder) CreateWithBGN ¶
func (b *Builder) CreateWithBGN(options *bg.BoardGameOptions) (bg.BoardGameWithBGN, error)
func (*Builder) Info ¶ added in v1.1.6
func (b *Builder) Info() *bg.BoardGameInfo
type MoveUnitActionDetails ¶
type StategoSnapshotData ¶
type StategoSnapshotData struct { Board [][]Unit Battle *Battle JustBattled bool Started bool Ready map[string]bool Variant string }
StategoSnapshotData is the game data unique to Statego
type Stratego ¶
type Stratego struct {
// contains filtered or unexported fields
}
func NewStratego ¶
func NewStratego(options *bg.BoardGameOptions) (*Stratego, error)
func (*Stratego) GetSnapshot ¶
func (s *Stratego) GetSnapshot(team ...string) (*bg.BoardGameSnapshot, error)
type StrategoMoreInfo ¶ added in v1.1.6
type StrategoMoreInfo struct {
Variants []string
}
type StrategoMoreOptions ¶
StrategoMoreOptions are the additional options for creating a game of Stratego
Click to show internal directories.
Click to hide internal directories.