Documentation
¶
Index ¶
- Variables
- type ISpace
- type Space
- func (this *Space) Destroy()
- func (this *Space) GCPool()
- func (this *Space) GetEntityID() uint64
- func (this *Space) Init() (err error)
- func (this *Space) Loop()
- func (this *Space) Looped()
- func (this *Space) Looping()
- func (this *Space) OnCreated(etype string, eid, dbid uint64, realPtr IEntity, spacePtr IEntities, fly bool, ...) error
- func (this *Space) OnPanic(err error)
- func (this *Space) ReLoop()
- func (this *Space) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSp_Navmash_Nil = common.NewError(-1, "Space.Init PathFindermgr == nil (%s,%s) ") )
Functions ¶
This section is empty.
Types ¶
type Space ¶
type Space struct {
/* 组合 */
SimpleEntity
DelayCallHost
//对象管理器
*Entities
MapID uint64 //地图ID
//地图名字
MapName string
// 地图唯一标识,空表示独立,有值的话,使用相同引用,这个逻辑由业务决定
MapKey string
//场景开始时间
StartTime time.Time
//时间轮
Timer *timerwheel.Timer
//寻路算法有关
PathFindermgr pathfinder.IPathFinder
// contains filtered or unexported fields
}
场景基础
func (*Space) OnCreated ¶
func (this *Space) OnCreated(etype string, eid, dbid uint64, realPtr IEntity, spacePtr IEntities, fly bool, param ...interface{}) error
在创建对象的时候调用 eid:实例的唯一ID etype:实例对象类型 dbid:实例持久化的唯一ID,如果没有持久化可以使用eid一样,也可以为0 realPtr:最外面的实例对象引用 spacePtr:最外面的实例所在空间的引用 fly:是否需要在redis中注册路由信息
Click to show internal directories.
Click to hide internal directories.