Documentation ¶
Index ¶
- type List
- type Player
- type PlayerInventory
- func (pi *PlayerInventory) Add(inst *object.Instance) error
- func (pi *PlayerInventory) Find(target string) (*object.Instance, bool)
- func (pi *PlayerInventory) GetAll() (result []*object.Instance)
- func (pi *PlayerInventory) GetByInstanceId(id uuid.UUID) (inst *object.Instance, exists bool)
- func (pi *PlayerInventory) GetByName(name string) (inst *object.Instance, exists bool)
- func (pi *PlayerInventory) GetByNameOrAlias(target string) (inst *object.Instance, exists bool)
- func (pi *PlayerInventory) Remove(inst *object.Instance) error
- type TestPlayer
- func (p *TestPlayer) AddInventory(instance *object.Instance) error
- func (p *TestPlayer) FindInventory(target string) (*object.Instance, bool)
- func (p *TestPlayer) GetAllInventory() []*object.Instance
- func (p *TestPlayer) GetCurrentHealth() int
- func (p *TestPlayer) GetInventoryById(id uuid.UUID) (*object.Instance, bool)
- func (p *TestPlayer) GetInventoryByName(name string) (*object.Instance, bool)
- func (p *TestPlayer) GetMaxHealth() int
- func (p *TestPlayer) GetName() string
- func (p *TestPlayer) GetSentResponse(i int) interface{}
- func (p *TestPlayer) RemoveInventory(instance *object.Instance) error
- func (p *TestPlayer) Send(msg interface{}) error
- func (p *TestPlayer) SentMessageCount() int
- func (p TestPlayer) Slots() *object.Slots
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type List ¶
func (*List) FindByName ¶
type Player ¶
type Player interface { Send(innerMessage interface{}) error GetName() string AddInventory(instance *object.Instance) error RemoveInventory(instance *object.Instance) error GetInventoryByName(definitionId string) (*object.Instance, bool) GetInventoryById(id uuid.UUID) (*object.Instance, bool) GetAllInventory() []*object.Instance FindInventory(target string) (*object.Instance, bool) Slots() *object.Slots GetCurrentHealth() int GetMaxHealth() int }
see https://play.golang.org/p/zPLyr3ZOM0 (first attempt) then see https://play.golang.org/p/z5athD5fV3 (client is an interface, but now pointer woes) noinspection GoNameStartsWithPackageName
type PlayerInventory ¶
type PlayerInventory struct {
// contains filtered or unexported fields
}
noinspection GoNameStartsWithPackageName
func NewPlayerInventory ¶
func NewPlayerInventory() *PlayerInventory
func (*PlayerInventory) Find ¶
func (pi *PlayerInventory) Find(target string) (*object.Instance, bool)
func (*PlayerInventory) GetAll ¶
func (pi *PlayerInventory) GetAll() (result []*object.Instance)
func (*PlayerInventory) GetByInstanceId ¶
func (pi *PlayerInventory) GetByInstanceId(id uuid.UUID) (inst *object.Instance, exists bool)
func (*PlayerInventory) GetByName ¶
func (pi *PlayerInventory) GetByName(name string) (inst *object.Instance, exists bool)
func (*PlayerInventory) GetByNameOrAlias ¶
func (pi *PlayerInventory) GetByNameOrAlias(target string) (inst *object.Instance, exists bool)
type TestPlayer ¶
type TestPlayer struct {
// contains filtered or unexported fields
}
func NewTestPlayer ¶
func NewTestPlayer(name string) *TestPlayer
create a new test player that can track sent messages through 'sentmessages'
func (*TestPlayer) AddInventory ¶
func (p *TestPlayer) AddInventory(instance *object.Instance) error
func (*TestPlayer) FindInventory ¶
func (p *TestPlayer) FindInventory(target string) (*object.Instance, bool)
func (*TestPlayer) GetAllInventory ¶
func (p *TestPlayer) GetAllInventory() []*object.Instance
func (*TestPlayer) GetCurrentHealth ¶
func (p *TestPlayer) GetCurrentHealth() int
func (*TestPlayer) GetInventoryById ¶
func (p *TestPlayer) GetInventoryById(id uuid.UUID) (*object.Instance, bool)
func (*TestPlayer) GetInventoryByName ¶
func (p *TestPlayer) GetInventoryByName(name string) (*object.Instance, bool)
func (*TestPlayer) GetMaxHealth ¶
func (p *TestPlayer) GetMaxHealth() int
func (*TestPlayer) GetName ¶
func (p *TestPlayer) GetName() string
func (*TestPlayer) GetSentResponse ¶
func (p *TestPlayer) GetSentResponse(i int) interface{}
func (*TestPlayer) RemoveInventory ¶
func (p *TestPlayer) RemoveInventory(instance *object.Instance) error
func (*TestPlayer) Send ¶
func (p *TestPlayer) Send(msg interface{}) error
func (*TestPlayer) SentMessageCount ¶
func (p *TestPlayer) SentMessageCount() int
func (TestPlayer) Slots ¶
func (p TestPlayer) Slots() *object.Slots
Click to show internal directories.
Click to hide internal directories.