Versions in this module Expand all Collapse all v0 v0.1.0 Oct 25, 2017 Changes in this version + func CollectEntitySyncInfos() + func CreateEntityAnywhere(typeName string) + func CreateEntityLocally(typeName string, data map[string]interface{}, client *GameClient) common.EntityID + func CreateSpaceAnywhere(kind int) + func CreateSpaceLocally(kind int) common.EntityID + func LoadEntityAnywhere(typeName string, entityID common.EntityID) + func LoadEntityLocally(typeName string, entityID common.EntityID) + func OnCall(id common.EntityID, method string, args [][]byte, clientID common.ClientID) + func OnClientDisconnected(clientid common.ClientID) + func OnDeclareService(serviceName string, entityid common.EntityID) + func OnGameTerminating() + func OnGateDisconnected(gateid uint16) + func OnMigrateRequestAck(entityID common.EntityID, spaceID common.EntityID, spaceLoc uint16) + func OnRealMigrate(entityID common.EntityID, spaceID common.EntityID, x, y, z float32, ...) + func OnSyncPositionYawFromClient(eid common.EntityID, x, y, z Coord, yaw Yaw) + func OnUndeclareService(serviceName string, entityid common.EntityID) + func RegisterSpace(spacePtr interface{}) + func RestoreFreezedEntities(freeze *FreezeData) (err error) + func SaveAllEntities() + func SetSaveInterval(duration time.Duration) + type AOICalculator interface + Adjust func(aoi *aoi) (enter []*aoi, leave []*aoi) + Enter func(aoi *aoi, pos Vector3) + Leave func(aoi *aoi) + Move func(aoi *aoi, newPos Vector3) + type Component struct + type Coord float32 + type Entity struct + Attrs *MapAttr + I interface{} + ID common.EntityID + Space *Space + TypeName string + V reflect.Value + func GetEntity(id common.EntityID) *Entity + func (e *Entity) AddCallback(d time.Duration, method string, args ...interface{}) EntityTimerID + func (e *Entity) AddTimer(d time.Duration, method string, args ...interface{}) EntityTimerID + func (e *Entity) Call(id common.EntityID, method string, args ...interface{}) + func (e *Entity) CallAllClients(method string, args ...interface{}) + func (e *Entity) CallClient(method string, args ...interface{}) + func (e *Entity) CallFitleredClients(key string, val string, method string, args ...interface{}) + func (e *Entity) CallService(serviceName string, method string, args ...interface{}) + func (e *Entity) CancelTimer(tid EntityTimerID) + func (e *Entity) DeclareService(serviceName string) + func (e *Entity) Destroy() + func (e *Entity) DistanceTo(other *Entity) Coord + func (e *Entity) EnterSpace(spaceID common.EntityID, pos Vector3) + func (e *Entity) FaceTo(other *Entity) + func (e *Entity) FaceToPos(pos Vector3) + func (e *Entity) ForAllClients(f func(client *GameClient)) + func (e *Entity) GetClient() *GameClient + func (e *Entity) GetFloat(key string) float64 + func (e *Entity) GetFreezeData() *entityFreezeData + func (e *Entity) GetInt(key string) int64 + func (e *Entity) GetListAttr(key string) *ListAttr + func (e *Entity) GetMapAttr(key string) *MapAttr + func (e *Entity) GetMigrateData() map[string]interface{} + func (e *Entity) GetPosition() Vector3 + func (e *Entity) GetStr(key string) string + func (e *Entity) GetYaw() Yaw + func (e *Entity) GiveClientTo(other *Entity) + func (e *Entity) IsDestroyed() bool + func (e *Entity) IsNeighbor(other *Entity) bool + func (e *Entity) IsPersistent() bool + func (e *Entity) IsSpaceEntity() bool + func (e *Entity) IsUseAOI() bool + func (e *Entity) LoadMigrateData(data map[string]interface{}) + func (e *Entity) Neighbors() EntitySet + func (e *Entity) OnClientConnected() + func (e *Entity) OnClientDisconnected() + func (e *Entity) OnCreated() + func (e *Entity) OnDestroy() + func (e *Entity) OnEnterSpace() + func (e *Entity) OnFreeze() + func (e *Entity) OnInit() + func (e *Entity) OnLeaveSpace(space *Space) + func (e *Entity) OnMigrateIn() + func (e *Entity) OnMigrateOut() + func (e *Entity) OnRestored() + func (e *Entity) PanicOnError(err error) + func (e *Entity) Post(cb func()) + func (e *Entity) Save() + func (e *Entity) SetClient(client *GameClient) + func (e *Entity) SetClientSyncing(syncing bool) + func (e *Entity) SetFilterProp(key string, val string) + func (e *Entity) SetPosition(pos Vector3) + func (e *Entity) SetYaw(yaw Yaw) + func (e *Entity) String() string + func (e *Entity) ToSpace() *Space + type EntityIDSet map[common.EntityID]struct + func GetServiceProviders(serviceName string) EntityIDSet + func (es EntityIDSet) Add(id common.EntityID) + func (es EntityIDSet) Contains(id common.EntityID) bool + func (es EntityIDSet) Del(id common.EntityID) + func (es EntityIDSet) ToList() []common.EntityID + type EntityMap map[common.EntityID]*Entity + func Entities() EntityMap + func (em EntityMap) Add(entity *Entity) + func (em EntityMap) Del(id common.EntityID) + func (em EntityMap) Get(id common.EntityID) *Entity + type EntitySet map[*Entity]struct + func (es EntitySet) Add(entity *Entity) + func (es EntitySet) Contains(entity *Entity) bool + func (es EntitySet) Del(entity *Entity) + func (es EntitySet) String() string + type EntityTimerID int + func (tid EntityTimerID) IsValid() bool + type EntityTypeDesc struct + func RegisterEntity(typeName string, entity interface{}, isPersistent bool, useAOI bool) *EntityTypeDesc + func (desc *EntityTypeDesc) DefineAttrs(attrDefs map[string][]string) + type FreezeData struct + Entities map[common.EntityID]*entityFreezeData + Services map[string][]common.EntityID + func Freeze(gameid uint16) (*FreezeData, error) + type GameClient struct + func MakeGameClient(clientid common.ClientID, gid uint16) *GameClient + func (client *GameClient) String() string + type ListAttr struct + func NewListAttr() *ListAttr + func (a *ListAttr) AppendBool(v bool) + func (a *ListAttr) AppendFloat(v float64) + func (a *ListAttr) AppendInt(v int64) + func (a *ListAttr) AppendListAttr(attr *ListAttr) + func (a *ListAttr) AppendMapAttr(attr *MapAttr) + func (a *ListAttr) AppendStr(v string) + func (a *ListAttr) AssignList(l []interface{}) + func (a *ListAttr) GetBool(index int) bool + func (a *ListAttr) GetFloat(index int) float64 + func (a *ListAttr) GetInt(index int) int64 + func (a *ListAttr) GetListAttr(index int) *ListAttr + func (a *ListAttr) GetMapAttr(index int) *MapAttr + func (a *ListAttr) GetStr(index int) string + func (a *ListAttr) PopBool() bool + func (a *ListAttr) PopFloat() float64 + func (a *ListAttr) PopInt() int64 + func (a *ListAttr) PopListAttr() *ListAttr + func (a *ListAttr) PopMapAttr() *MapAttr + func (a *ListAttr) PopStr() string + func (a *ListAttr) SetBool(index int, v bool) + func (a *ListAttr) SetFloat(index int, v float64) + func (a *ListAttr) SetInt(index int, v int64) + func (a *ListAttr) SetListAttr(index int, attr *ListAttr) + func (a *ListAttr) SetMapAttr(index int, attr *MapAttr) + func (a *ListAttr) SetStr(index int, v string) + func (a *ListAttr) Size() int + func (a *ListAttr) ToList() []interface{} + type MapAttr struct + func NewMapAttr() *MapAttr + func (a *MapAttr) AssignMap(doc map[string]interface{}) + func (a *MapAttr) AssignMapWithFilter(doc map[string]interface{}, filter func(string) bool) + func (a *MapAttr) Del(key string) + func (a *MapAttr) ForEach(f func(key string, val interface{})) + func (a *MapAttr) ForEachKey(f func(key string)) + func (a *MapAttr) Get(key string) interface{} + func (a *MapAttr) GetBool(key string) bool + func (a *MapAttr) GetFloat(key string) float64 + func (a *MapAttr) GetInt(key string) int64 + func (a *MapAttr) GetListAttr(key string) *ListAttr + func (a *MapAttr) GetMapAttr(key string) *MapAttr + func (a *MapAttr) GetStr(key string) string + func (a *MapAttr) HasKey(key string) bool + func (a *MapAttr) Keys() []string + func (a *MapAttr) Pop(key string) interface{} + func (a *MapAttr) PopMapAttr(key string) *MapAttr + func (a *MapAttr) SetBool(key string, v bool) + func (a *MapAttr) SetDefaultBool(key string, v bool) + func (a *MapAttr) SetDefaultFloat(key string, v float64) + func (a *MapAttr) SetDefaultInt(key string, v int64) + func (a *MapAttr) SetDefaultListAttr(key string, attr *ListAttr) + func (a *MapAttr) SetDefaultMapAttr(key string, attr *MapAttr) + func (a *MapAttr) SetDefaultStr(key string, v string) + func (a *MapAttr) SetFloat(key string, v float64) + func (a *MapAttr) SetInt(key string, v int64) + func (a *MapAttr) SetListAttr(key string, attr *ListAttr) + func (a *MapAttr) SetMapAttr(key string, attr *MapAttr) + func (a *MapAttr) SetStr(key string, v string) + func (a *MapAttr) Size() int + func (a *MapAttr) ToMap() map[string]interface{} + func (a *MapAttr) ToMapWithFilter(filter func(string) bool) map[string]interface{} + type Space struct + Kind int + func (space *Space) CountEntities(typeName string) int + func (space *Space) CreateEntity(typeName string, pos Vector3) + func (space *Space) ForEachEntity(f func(e *Entity)) + func (space *Space) GetEntity(entityID common.EntityID) *Entity + func (space *Space) GetEntityCount() int + func (space *Space) IsNil() bool + func (space *Space) LoadEntity(typeName string, entityID common.EntityID, pos Vector3) + func (space *Space) OnCreated() + func (space *Space) OnDestroy() + func (space *Space) OnEntityEnterSpace(entity *Entity) + func (space *Space) OnEntityLeaveSpace(entity *Entity) + func (space *Space) OnInit() + func (space *Space) OnRestored() + func (space *Space) OnSpaceCreated() + func (space *Space) OnSpaceDestroy() + func (space *Space) String() string + type Vector3 struct + X Coord + Y Coord + Z Coord + func (dir Vector3) DirToYaw() Yaw + func (p *Vector3) Normalize() + func (p Vector3) Add(o Vector3) Vector3 + func (p Vector3) DistanceTo(o Vector3) Coord + func (p Vector3) Mul(m Coord) Vector3 + func (p Vector3) Normalized() Vector3 + func (p Vector3) String() string + func (p Vector3) Sub(o Vector3) Vector3 + type XZListAOICalculator struct + func (cal *XZListAOICalculator) Adjust(aoi *aoi) (enter []*aoi, leave []*aoi) + func (cal *XZListAOICalculator) Enter(aoi *aoi, pos Vector3) + func (cal *XZListAOICalculator) Leave(aoi *aoi) + func (cal *XZListAOICalculator) Move(aoi *aoi, pos Vector3) + type Yaw float32