Documentation ¶
Index ¶
- type Field
- type Instance
- func (inst *Instance) AddPlayer(plr player) error
- func (inst *Instance) AddRoom(r room.Room)
- func (inst Instance) CalculateNearestSpawnPortalID(pos pos.Data) (byte, error)
- func (inst Instance) FindController() interface{}
- func (inst Instance) GetPlayerFromID(id int32) (player, error)
- func (inst *Instance) GetPlayerRoom(id int32) (room.Room, error)
- func (inst Instance) GetPortalFromID(id byte) (Portal, error)
- func (inst Instance) GetPortalFromName(name string) (Portal, error)
- func (inst Instance) GetRandomSpawnPortal() (Portal, error)
- func (inst *Instance) GetRoomID(id int32) (room.Room, error)
- func (inst Instance) ID() int
- func (inst *Instance) LifePool() *lifepool.Data
- func (inst Instance) MovePlayer(id int32, moveBytes []byte, plr player)
- func (inst *Instance) NextID() int32
- func (inst *Instance) RemovePlayer(plr player) error
- func (inst *Instance) RemoveRoom(r room.Room) error
- func (inst Instance) Send(p mpacket.Packet) error
- func (inst Instance) SendExcept(p mpacket.Packet, exception mnet.Client) error
- func (inst Instance) String() string
- func (inst *Instance) UpdateGameBox(r room.Room)
- type Portal
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field struct { ID int32 Data nx.Map Dispatch chan func() // contains filtered or unexported fields }
Field data
func (*Field) CalculateFieldLimits ¶
func (f *Field) CalculateFieldLimits()
CalculateFieldLimits for mob spawning
func (*Field) ChangePlayerInstance ¶
ChangePlayerInstance id
func (*Field) GetInstance ¶
GetInstance from id
type Instance ¶
type Instance struct {
// contains filtered or unexported fields
}
Instance data for a field
func (Instance) CalculateNearestSpawnPortalID ¶
CalculateNearestSpawnPortalID from a given position
func (Instance) FindController ¶
func (inst Instance) FindController() interface{}
FindController in instance, need to return interface for casting
func (Instance) GetPlayerFromID ¶
GetPlayerFromID from the instance
func (*Instance) GetPlayerRoom ¶
GetPlayerRoom the room the player belongs to
func (Instance) GetPortalFromID ¶
GetPortalFromID in the current instance
func (Instance) GetPortalFromName ¶
GetPortalFromName in the current instance
func (Instance) GetRandomSpawnPortal ¶
GetRandomSpawnPortal returns a spawn potal at random
func (Instance) MovePlayer ¶
MovePlayer for other players
func (*Instance) RemovePlayer ¶
RemovePlayer from instance
func (*Instance) RemoveRoom ¶
RemoveRoom from instance
func (Instance) SendExcept ¶
SendExcept - sends packet to instance except a particular player
func (*Instance) UpdateGameBox ¶
UpdateGameBox above player head in map
type Portal ¶
type Portal struct {
// contains filtered or unexported fields
}
Portal that can be plaed in a field
func (Portal) DestFieldID ¶
DestFieldID the portal takes the player