EntityPool类
指实体的存储类。
EntityPool类的实现存放在路径下文件data/framework/game/level.h中。
EntityPool Class
成员
EntityPool (string name)
构造函数。 用来在指定命名空间中创建新EntityPool类的实例。参数
- string name - 指命名空间的名称,该命名空间描述了所有的实体类。
void append (Entity entity)
其作用是将实体添加给内存池。参数
- Entity entity - 指要追加的实体。
Entity getEntity (string type)
其作用是检查实体是否在内存池中。参数
- string type - 指实体类型。
返回值
如果内存池中存在某个实体则返回该实体;否则返回NULLvoid clear ()
其作用是清空实体内存池。最新更新: 2017-07-03
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)