Documentation ¶
Index ¶
- type Game
- func (g *Game) AddBoard(board interfaces.Board)
- func (g *Game) AddEntity(entity interfaces.Entity)
- func (g *Game) AddPlayer(player interfaces.Player, entity interfaces.Entity)
- func (g *Game) AddSpectator(spec interfaces.Spectator)
- func (g *Game) CanMoveToSpace(targetBoardId, locX, locY int) bool
- func (g *Game) GetBoard(boardId int) interfaces.Board
- func (g *Game) GetBoards() map[int]interfaces.Board
- func (g *Game) GetCurrentBoard() int
- func (g *Game) GetEntities() map[int]interfaces.Entity
- func (g *Game) GetEntitiesAtSpace(boardId, x, y int) []interfaces.Entity
- func (g *Game) GetEntity(entid int) interfaces.Entity
- func (g *Game) GetEntityByPlayer(player interfaces.Player) interfaces.Entity
- func (g *Game) GetLastTick() int
- func (g *Game) GetNumBoards() int
- func (g *Game) GetPlayer(id int) interfaces.Player
- func (g *Game) GetPlayerByEntity(entity interfaces.Entity) interfaces.Player
- func (g *Game) GetPlayers() map[int]interfaces.Player
- func (g *Game) GetRandomEmptySpace() (int, int)
- func (g *Game) GetSpectators() map[int]interfaces.Spectator
- func (g *Game) GetTangibleEntityAtSpace(bId, x, y int) interfaces.Entity
- func (g *Game) IsFire(boardId, x, y int) bool
- func (g *Game) IsWall(boardId, x, y int) bool
- func (g *Game) IsWater(boardId, x, y int) bool
- func (g *Game) Json(player interfaces.Player) string
- func (g *Game) NextBoard()
- func (g *Game) PlaceAtNearestTile(ent interfaces.Entity, boardId, x, y int)
- func (g *Game) Run()
- func (g *Game) SetLastTick(tick int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Game ¶
type Game struct { Players map[int]interfaces.Player Spectators map[int]interfaces.Spectator Boards map[int]interfaces.Board Entities map[int]interfaces.Entity PlayersToEntities map[interfaces.Player]interfaces.Entity LastTick, CurrentBoard, NumBoards int GameRunning bool }
func (*Game) AddBoard ¶
func (g *Game) AddBoard(board interfaces.Board)
func (*Game) AddEntity ¶
func (g *Game) AddEntity(entity interfaces.Entity)
func (*Game) AddPlayer ¶
func (g *Game) AddPlayer(player interfaces.Player, entity interfaces.Entity)
func (*Game) AddSpectator ¶
func (g *Game) AddSpectator(spec interfaces.Spectator)
func (*Game) CanMoveToSpace ¶
Checks if an entity may be placed into a given tile on the current board
func (*Game) GetCurrentBoard ¶
func (*Game) GetEntities ¶
func (g *Game) GetEntities() map[int]interfaces.Entity
func (*Game) GetEntitiesAtSpace ¶
func (g *Game) GetEntitiesAtSpace(boardId, x, y int) []interfaces.Entity
func (*Game) GetEntityByPlayer ¶
func (g *Game) GetEntityByPlayer(player interfaces.Player) interfaces.Entity
func (*Game) GetLastTick ¶
func (*Game) GetNumBoards ¶
func (*Game) GetPlayerByEntity ¶
func (g *Game) GetPlayerByEntity(entity interfaces.Entity) interfaces.Player
func (*Game) GetPlayers ¶
func (g *Game) GetPlayers() map[int]interfaces.Player
func (*Game) GetRandomEmptySpace ¶
Picks a random empty space
func (*Game) GetSpectators ¶
func (g *Game) GetSpectators() map[int]interfaces.Spectator
func (*Game) GetTangibleEntityAtSpace ¶
func (g *Game) GetTangibleEntityAtSpace(bId, x, y int) interfaces.Entity
func (*Game) Json ¶
func (g *Game) Json(player interfaces.Player) string
Generates the gamestate for the given player's perspective
func (*Game) PlaceAtNearestTile ¶
func (g *Game) PlaceAtNearestTile(ent interfaces.Entity, boardId, x, y int)
func (*Game) SetLastTick ¶
Click to show internal directories.
Click to hide internal directories.