Documentation ¶
Index ¶
- type Bomb
- type Creature
- func (c *Creature) Battle(fight func(z.ICreature))
- func (c *Creature) ChangeHealth(broadcast bool, health int)
- func (c *Creature) ChangeStrength(broadcast bool, strength int)
- func (c *Creature) ChangeTreasure(broadcast bool, treasure int)
- func (c *Creature) Dead() bool
- func (c *Creature) GetHealth() int
- func (c *Creature) GetNext() (int, int)
- func (c *Creature) GetStrength() int
- func (c *Creature) GetTreasure() int
- func (c *Creature) Halted() bool
- func (c *Creature) LoadRooms(rooms z.IRooms)
- func (c *Creature) Move(broadcast bool, nextX, nextY int)
- func (c *Creature) Next(broadcast bool, x, y int)
- func (c *Creature) Release(broadcast bool)
- func (c *Creature) Stay(broadcast bool)
- type GameObject
- func (g *GameObject) Body()
- func (g *GameObject) Delete(broadcast bool)
- func (g *GameObject) Deleted() bool
- func (g *GameObject) Event(action string) *z.Message
- func (g *GameObject) GetClass() string
- func (g *GameObject) GetColor() tb.Attribute
- func (g *GameObject) GetID() string
- func (g *GameObject) GetName() string
- func (g *GameObject) GetPosition() (int, int)
- func (g *GameObject) GetSymbol() rune
- func (g *GameObject) JSON() ([]byte, error)
- func (g *GameObject) Loop(sleepMain, sleepPaused int, body func())
- func (g *GameObject) Run(broadcast bool)
- func (g *GameObject) Running() bool
- func (g *GameObject) SetColor(color tb.Attribute)
- func (g *GameObject) SetID(broadcast bool, id string)
- func (g *GameObject) SetName(broadcast bool, name string)
- func (g *GameObject) SetPosition(broadcast bool, x, y int)
- func (g *GameObject) Start(broadcast bool)
- func (g *GameObject) Stop(broadcast bool)
- type Health
- type Item
- type Missle
- type Monster
- type Player
- type Portal
- type Room
- func (r *Room) Enter(broadcast bool, g z.IGameObject)
- func (r *Room) GetCreatures() []z.ICreature
- func (r *Room) GetGameObjects() []z.IGameObject
- func (r *Room) GetHealths() []z.IHealth
- func (r *Room) GetStrengths() []z.IStrength
- func (r *Room) GetTreasures() []z.ITreasure
- func (r *Room) HasRoom() bool
- func (r *Room) HasRoomForTwo() bool
- func (r *Room) Leave(broadcast bool, g z.IGameObject)
- type Strength
- type Treasure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Creature ¶
type Creature struct { *GameObject WorldWidth int WorldHeight int NextX int NextY int Health int Strength int Treasure int Stuck bool // contains filtered or unexported fields }
func NewCreature ¶
func (*Creature) ChangeHealth ¶
func (*Creature) ChangeStrength ¶
func (*Creature) ChangeTreasure ¶
func (*Creature) GetStrength ¶
func (*Creature) GetTreasure ¶
type GameObject ¶
type GameObject struct { sync.RWMutex Paused bool Removed bool Class string Name string Symbol rune Color tb.Attribute X int Y int ID string // contains filtered or unexported fields }
func NewGameObject ¶
func NewGameObject(broadcast chan *z.Message) *GameObject
func (*GameObject) Body ¶
func (g *GameObject) Body()
func (*GameObject) Delete ¶
func (g *GameObject) Delete(broadcast bool)
func (*GameObject) Deleted ¶
func (g *GameObject) Deleted() bool
func (*GameObject) GetClass ¶
func (g *GameObject) GetClass() string
func (*GameObject) GetColor ¶
func (g *GameObject) GetColor() tb.Attribute
func (*GameObject) GetID ¶
func (g *GameObject) GetID() string
func (*GameObject) GetName ¶
func (g *GameObject) GetName() string
func (*GameObject) GetPosition ¶
func (g *GameObject) GetPosition() (int, int)
func (*GameObject) GetSymbol ¶
func (g *GameObject) GetSymbol() rune
func (*GameObject) JSON ¶
func (g *GameObject) JSON() ([]byte, error)
func (*GameObject) Loop ¶
func (g *GameObject) Loop(sleepMain, sleepPaused int, body func())
func (*GameObject) Run ¶
func (g *GameObject) Run(broadcast bool)
func (*GameObject) Running ¶
func (g *GameObject) Running() bool
func (*GameObject) SetColor ¶
func (g *GameObject) SetColor(color tb.Attribute)
func (*GameObject) SetID ¶
func (g *GameObject) SetID(broadcast bool, id string)
func (*GameObject) SetName ¶
func (g *GameObject) SetName(broadcast bool, name string)
func (*GameObject) SetPosition ¶
func (g *GameObject) SetPosition(broadcast bool, x, y int)
func (*GameObject) Start ¶
func (g *GameObject) Start(broadcast bool)
func (*GameObject) Stop ¶
func (g *GameObject) Stop(broadcast bool)
type Item ¶
type Item struct { *GameObject Points int }
type Monster ¶
type Monster struct { *Creature PlayerID string Difficulty int // contains filtered or unexported fields }
func NewMonster ¶
func (*Monster) LoadPlayer ¶
func (m *Monster) LoadPlayer()
func (*Monster) LoadPlayers ¶
func (m *Monster) LoadPlayers(players z.IGameObjectMap)
type Room ¶
type Room struct { *GameObject GameObjects map[z.IGameObject]z.IGameObject Capacity int sync.RWMutex }
func (*Room) GetCreatures ¶
func (*Room) GetGameObjects ¶
func (r *Room) GetGameObjects() []z.IGameObject
func (*Room) GetHealths ¶
func (*Room) GetStrengths ¶
func (*Room) GetTreasures ¶
func (*Room) HasRoomForTwo ¶
Click to show internal directories.
Click to hide internal directories.