component.h:
class Entity;
class Component {
...
Entity *parent;
};
Run Code Online (Sandbox Code Playgroud)
entity.h:
#include "component.h"
class Entity {
...
}
Run Code Online (Sandbox Code Playgroud)
这里唯一的缺点是component.h中的内联方法不能使用Entity方法.
| 归档时间: |
|
| 查看次数: |
494 次 |
| 最近记录: |