Documentation ¶
Overview ¶
Functions to configure the basics of different entity types
Index ¶
- Variables
- func NewChest(g interfaces.Game) interfaces.Entity
- func NewGargoyle(g interfaces.Game) interfaces.Entity
- func NewShade(g interfaces.Game) interfaces.Entity
- func NewShielder(g interfaces.Game) interfaces.Entity
- type Entity
- func New(entid int, g interfaces.Game) *Entity
- func NewAbilityTrigger(g interfaces.Game, abilityCode string) *Entity
- func NewBoulder(g interfaces.Game, roll interfaces.Direction) *Entity
- func NewBoulderTrap(g interfaces.Game, wallDir interfaces.Direction) *Entity
- func NewCaltropTrap(g interfaces.Game) *Entity
- func NewInertStatue(g interfaces.Game) *Entity
- func NewSprungTrap(g interfaces.Game) *Entity
- func NewStairsUp(g interfaces.Game) *Entity
- func NewTeleportTrap(g interfaces.Game, x, y int) *Entity
- func NewTree(g interfaces.Game) *Entity
- func (e *Entity) ChangeArdour(difference int) int
- func (e *Entity) Die()
- func (e *Entity) GetActionQueue() []interfaces.Action
- func (e *Entity) GetArdour() int
- func (e *Entity) GetEntityId() int
- func (e *Entity) GetMaxArdour() int
- func (e *Entity) GetName() string
- func (e *Entity) GetPosition() (boardid, x, y int)
- func (e *Entity) GetStringActionQueue() []string
- func (e *Entity) GetSubtype() string
- func (e *Entity) GetType() string
- func (e *Entity) IsDead() bool
- func (e *Entity) IsTangible() bool
- func (e *Entity) PopAction() interfaces.Action
- func (me *Entity) RunTurn(tick int) bool
- func (e *Entity) SetActionQueue(aq []interfaces.Action)
- func (e *Entity) SetArdour(ardour int)
- func (e *Entity) SetEntityId(id int)
- func (e *Entity) SetMaxArdour(ardour int)
- func (e *Entity) SetName(name string)
- func (e *Entity) SetPosition(boardId, x, y int)
- func (e *Entity) SetSubtype(t string)
- func (e *Entity) SetTangible(tangible bool)
- func (e *Entity) SetType(t string)
- func (e *Entity) SwapPositionWith(other interfaces.Entity)
- func (e *Entity) Trodden(by interfaces.Entity)
Constants ¶
This section is empty.
Variables ¶
View Source
var UIDG = uidgenerator.New()
Functions ¶
func NewChest ¶
func NewChest(g interfaces.Game) interfaces.Entity
func NewGargoyle ¶
func NewGargoyle(g interfaces.Game) interfaces.Entity
func NewShade ¶
func NewShade(g interfaces.Game) interfaces.Entity
func NewShielder ¶
func NewShielder(g interfaces.Game) interfaces.Entity
Types ¶
type Entity ¶
type Entity struct {
EntityId, BoardId, X, Y, Ardour, MaxArdour int
Game interfaces.Game
Name, Type, Subtype string
Tangible, Dead bool
DeathFunction func()
TroddenFunction func(interfaces.Entity)
RepositionFunction func(fromBId, fromX, fromY, toBId, toX, toY int)
TurnFunction func(int) bool
ActionQueue []interfaces.Action
}
func NewAbilityTrigger ¶
func NewAbilityTrigger(g interfaces.Game, abilityCode string) *Entity
func NewBoulder ¶
func NewBoulder(g interfaces.Game, roll interfaces.Direction) *Entity
Spawns a rolling boulder in a given direction, which is one of * N, E, S, or W
func NewBoulderTrap ¶
func NewBoulderTrap(g interfaces.Game, wallDir interfaces.Direction) *Entity
Makes a boulder trap that throws a boulder from the nearest wall * in the given direction
func NewCaltropTrap ¶
func NewCaltropTrap(g interfaces.Game) *Entity
func NewInertStatue ¶
func NewInertStatue(g interfaces.Game) *Entity
func NewSprungTrap ¶
func NewSprungTrap(g interfaces.Game) *Entity
func NewStairsUp ¶
func NewStairsUp(g interfaces.Game) *Entity
func NewTeleportTrap ¶
func NewTeleportTrap(g interfaces.Game, x, y int) *Entity
func NewTree ¶
func NewTree(g interfaces.Game) *Entity
func (*Entity) ChangeArdour ¶
func (*Entity) GetActionQueue ¶
func (e *Entity) GetActionQueue() []interfaces.Action
func (*Entity) GetEntityId ¶
func (*Entity) GetMaxArdour ¶
func (*Entity) GetPosition ¶
func (*Entity) GetStringActionQueue ¶
func (*Entity) GetSubtype ¶
func (*Entity) IsTangible ¶
func (*Entity) PopAction ¶
func (e *Entity) PopAction() interfaces.Action
func (*Entity) RunTurn ¶
Runs custom code for the entity's turn. Useful for programming monsters * and the like. * * Returns true if it did something that should be announced to the players.
func (*Entity) SetActionQueue ¶
func (e *Entity) SetActionQueue(aq []interfaces.Action)
func (*Entity) SetEntityId ¶
TODO should force entity to be unique
func (*Entity) SetMaxArdour ¶
func (*Entity) SetPosition ¶
func (*Entity) SetSubtype ¶
func (*Entity) SetTangible ¶
func (*Entity) SwapPositionWith ¶
func (e *Entity) SwapPositionWith(other interfaces.Entity)
func (*Entity) Trodden ¶
func (e *Entity) Trodden(by interfaces.Entity)
Click to show internal directories.
Click to hide internal directories.