Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( MapImages = map[int]image.Image{} MapImageKeyFmt = "m-%d" )
Functions ¶
This section is empty.
Types ¶
type Line ¶ added in v1.0.3
type Line struct { Towers map[string]*Tower Units map[string]*Unit Graph *graph.Graph // UpdatedAt is the last time // something was updated on this Line. // Towers added, Units added or // when the Units position was updated // the last time. // Used for the SyncState to know how much // time has passed since the last update // and move the Units accordingly // (60 moves per second pass) UpdatedAt time.Time }
type Lines ¶ added in v1.0.3
type Lines struct { *flux.ReduceStore // contains filtered or unexported fields }
type LinesState ¶ added in v1.0.3
type Map ¶
type Map struct { *flux.ReduceStore // contains filtered or unexported fields }
Map is a struct that holds all the information of the current map
func (*Map) GetImageKey ¶ added in v1.0.3
GetY returns the max Y value of the map
func (*Map) GetNextLineID ¶
GetNextLineID based on the map and max number of players it returns the next one and when it reaches the end then starts again
type Player ¶
type Player struct { ID string Name string Lives int LineID int Income int Gold int Current bool Winner bool }
func (Player) CanPlaceTower ¶
func (Player) CanSummonUnit ¶
type Players ¶
type Players struct { *flux.ReduceStore // contains filtered or unexported fields }
func NewPlayers ¶
func (*Players) FindByLineID ¶
func (*Players) FindCurrent ¶
type PlayersState ¶
type Store ¶
type Unit ¶
type Unit struct { utils.MovingObject ID string Type string PlayerID string PlayerLineID int CurrentLineID int Health float64 Path []graph.Step HashPath string // CreatedAt has the time of creation so // on the next SyncState will be moved just // the diff amount and then it'll be set to 'nil' // so we know it's on sync CreatedAt time.Time }
func (*Unit) FacesetKey ¶ added in v1.0.3
Click to show internal directories.
Click to hide internal directories.