Documentation ¶
Index ¶
- Constants
- func InRange(id string, playerIndex int, r int, x int, y int) []interfaces.Entity
- func InitGameState()
- func New2DArray[V any](x int, y int) [][]V
- func Print2DArray(grid [][]int)
- type Army
- type Assets
- type BattleGround
- func (re *BattleGround) GetEntityAtLocation(l interfaces.Location) interfaces.Entity
- func (re *BattleGround) IsBattleGroundLocationFree(l interfaces.Location) bool
- func (re *BattleGround) IsBattleGroundLocationRectFree(x int, y int, w int, h int) bool
- func (re *BattleGround) PlaceBattleGroundEntity(entity interfaces.Entity)
- func (re *BattleGround) RemoveBattleGroundEntity(entity interfaces.Entity)
- func (re *BattleGround) RemoveEntity(l interfaces.Location)
- func (re *BattleGround) UpdateBattleGroundEntity(entity interfaces.Entity)
- type DraggingGrid
- type FlashMessage
- type GameState
- type GameStateUpdater
- type GameStates
- type JsonSerializable
- type Model
- type ModelNumber
- type ModelType
- type Phase
- type PhaseEventBus
- type PhaseStep
- type Player
- type RGBA
- type ShootingWeapon
- type Size
- type Stack
- type StatusMessage
- type Token
- type UIState
- type Unit
- func (re *Unit) AddState(state UnitState)
- func (re Unit) CanMove() bool
- func (re Unit) CanShoot() bool
- func (re *Unit) Cleanup()
- func (re *Unit) ClearStates()
- func (re Unit) DrawUnitSelected(screen *ebiten.Image)
- func (re *Unit) GetAssetPath(assetName string, ext string) string
- func (re *Unit) GetDestroyedModelByID(id string) *Model
- func (re *Unit) GetEntityType() interfaces.EntityType
- func (re *Unit) GetID() string
- func (re *Unit) GetLocation() interfaces.Location
- func (re *Unit) GetModelByID(id string) *Model
- func (re *Unit) GetModelIndexByID(id string) int
- func (re Unit) GetMoraleCheck() int
- func (re *Unit) GetPlayerIndex() int
- func (re *Unit) GetTargetRange() interfaces.Location
- func (re *Unit) GetToken() *ebiten.Image
- func (re *Unit) InflictWounds(targetModel Model, str int) (bool, Model)
- func (re *Unit) MoraleFailure()
- func (re *Unit) Remove()
- func (re *Unit) SetLocation(location interfaces.Location)
- func (re *Unit) SetTargetRange(l interfaces.Location)
- type UnitState
- type ViewPort
- type Weapon
- type WeaponType
Constants ¶
View Source
const ( MovementPhase Phase = "MovementPhase" MovementPhase_UnitSelection PhaseStep = "MovementPhase_UnitSelection" MovementPhase_Moving PhaseStep = "MovementPhase_Moving" )
Variables ¶
This section is empty.
Functions ¶
func InitGameState ¶
func InitGameState()
func New2DArray ¶
func Print2DArray ¶
func Print2DArray(grid [][]int)
Types ¶
type Army ¶
func (*Army) RemoveDestroyedUnits ¶
func (re *Army) RemoveDestroyedUnits()
type BattleGround ¶
type BattleGround struct { Size Size ViewPort ViewPort Grid [][]interfaces.Entity }
func NewBattleGround ¶
func NewBattleGround(x int, y int) *BattleGround
func (*BattleGround) GetEntityAtLocation ¶
func (re *BattleGround) GetEntityAtLocation(l interfaces.Location) interfaces.Entity
return entity at location if any
func (*BattleGround) IsBattleGroundLocationFree ¶
func (re *BattleGround) IsBattleGroundLocationFree(l interfaces.Location) bool
check if a location is empty
func (*BattleGround) IsBattleGroundLocationRectFree ¶
func (*BattleGround) PlaceBattleGroundEntity ¶
func (re *BattleGround) PlaceBattleGroundEntity(entity interfaces.Entity)
put an entity on the battleground thus taking up space
func (*BattleGround) RemoveBattleGroundEntity ¶
func (re *BattleGround) RemoveBattleGroundEntity(entity interfaces.Entity)
put an entity on the battleground thus taking up space
func (*BattleGround) RemoveEntity ¶
func (re *BattleGround) RemoveEntity(l interfaces.Location)
func (*BattleGround) UpdateBattleGroundEntity ¶
func (re *BattleGround) UpdateBattleGroundEntity(entity interfaces.Entity)
put an entity on the battleground thus taking up space
type DraggingGrid ¶
type FlashMessage ¶
type GameState ¶
type GameState struct { Initialized bool CurrentGameState GameStates Round int BattleGround BattleGround PhaseStepper interfaces.PhaseStepper DiceRoller interfaces.DiceRoller Players [consts.MaxPlayers]Player CurrentPlayer *Player CurrentPlayerIndex int OpponetPlayerIndex int StartPlayerIndex int SelectedUnit *Unit DraggingUnit *Unit DraggingUnitLocation interfaces.Location SelectedPhaseUnit *Unit SelectedTargetUnit *Unit SelectedModel *Model SelectedWeapon *ShootingWeapon Assets Assets UIState UIState StatusMessage StatusMessage Dice []int GameStateUpdater GameStateUpdater Drawer interfaces.Draw WeaponAbilityList interfaces.WeaponAbilityList GameOver bool PhaseEventBus PhaseEventBus }
type GameStateUpdater ¶
type GameStateUpdater struct { }
func (GameStateUpdater) Init ¶
func (re GameStateUpdater) Init()
func (GameStateUpdater) UpdateModel ¶
func (re GameStateUpdater) UpdateModel(player int, model *Model)
func (GameStateUpdater) UpdateUnit ¶
func (re GameStateUpdater) UpdateUnit(player int, unit *Unit)
type JsonSerializable ¶
type JsonSerializable interface{}
type Model ¶
type Model struct { ID string Name string ShortName string Count int ModelNumber ModelNumber Movement int WeaponSkill string BallisticSkill string Strength int Toughness int CurrentWounds int Wounds int Destroyed bool Attacks int Leadership int Save string DefaultWeapons []string Weapons []Weapon SelectedWeapon Weapon ModelType ModelType PlayerIndex int }
func (*Model) ClearFiredWeapon ¶
func (re *Model) ClearFiredWeapon()
func (Model) GetBallisticSkill ¶
func (Model) GetIntSkill ¶
func (Model) GetUnfiredWeapon ¶
func (*Model) SetFiredWeapon ¶
type ModelNumber ¶
type PhaseEventBus ¶
type PhaseEventBus struct {
// contains filtered or unexported fields
}
func NewPhaseEventBus ¶
func NewPhaseEventBus() *PhaseEventBus
func (PhaseEventBus) Fire ¶
func (re PhaseEventBus) Fire(eventID string)
func (PhaseEventBus) RegisterEventHandler ¶
func (re PhaseEventBus) RegisterEventHandler(eventID string, handler func())
type Player ¶
func (*Player) PhaseCleanup ¶
func (re *Player) PhaseCleanup()
func (*Player) RoundCleanup ¶
func (re *Player) RoundCleanup()
type ShootingWeapon ¶
type StatusMessage ¶
func (*StatusMessage) Clear ¶
func (re *StatusMessage) Clear()
type UIState ¶
type UIState struct { ShowGrid bool GridDragging DraggingGrid }
type Unit ¶
type Unit struct { ID string Name string Army string Models []*Model ModelCount map[string]int DestroyedModels []*Model Power int Location interfaces.Location UnitState []UnitState Destroyed bool OriginalModelCount int CurrentMoves int PlayerIndex int Width int Height int Rect ui.Rect Token Token TargetRange interfaces.Location }
func (*Unit) ClearStates ¶
func (re *Unit) ClearStates()
func (Unit) DrawUnitSelected ¶
func (re Unit) DrawUnitSelected(screen *ebiten.Image)
func (*Unit) GetDestroyedModelByID ¶
func (*Unit) GetEntityType ¶
func (re *Unit) GetEntityType() interfaces.EntityType
func (*Unit) GetLocation ¶
func (re *Unit) GetLocation() interfaces.Location
func (*Unit) GetModelByID ¶
func (*Unit) GetModelIndexByID ¶
func (Unit) GetMoraleCheck ¶
func (*Unit) GetPlayerIndex ¶
func (*Unit) GetTargetRange ¶
func (re *Unit) GetTargetRange() interfaces.Location
func (*Unit) InflictWounds ¶
func (*Unit) MoraleFailure ¶
func (re *Unit) MoraleFailure()
func (*Unit) SetLocation ¶
func (re *Unit) SetLocation(location interfaces.Location)
func (*Unit) SetTargetRange ¶
func (re *Unit) SetTargetRange(l interfaces.Location)
type ViewPort ¶
func (ViewPort) GetPixelRectangle ¶
func (re ViewPort) GetPixelRectangle() interfaces.Rectangle
type Weapon ¶
type Weapon struct { Name string Range int WeaponType WeaponType Strength int ArmorPiercing int Damage int Abilities []string Fired bool }
func (Weapon) ApplyBlast ¶
func (*Weapon) GetWeaponAbilities ¶
func (*Weapon) SetArmorPiercing ¶
type WeaponType ¶
func (WeaponType) GetAttacks ¶
func (re WeaponType) GetAttacks(attacks int, target interfaces.Entity, shootingWeapon ShootingWeapon) int
Click to show internal directories.
Click to hide internal directories.