-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathUnit.h
More file actions
58 lines (46 loc) · 1.14 KB
/
Copy pathUnit.h
File metadata and controls
58 lines (46 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright 2008-2018 Yolo Technologies, Inc. All Rights Reserved. https://www.comblockengine.com
#ifndef KBE_ENTITY_H
#define KBE_ENTITY_H
//#include "helper/profile.h"
#include "common/timer.h"
#include "common/common.h"
#include "common/smartpointer.h"
#include "helper/debug_helper.h"
//#include "pyscript/math.h"
#include "pyscript/scriptobject.h"
namespace KBEngine{
class Unit;
//typedef SmartPointer<Unit> UnitPtr;
//typedef std::vector<UnitPtr> SPACE_ENTITIES;
class Unit : public script::ScriptObject
{
/** 子类化 将一些py操作填充进派生类 */
BASE_SCRIPT_HREADER(Unit, ScriptObject)
public:
Unit(ENTITY_ID id,
PyTypeObject* pyType = getScriptType(), bool isInitialised = true);
~Unit();
/**
销毁这个Uint
*/
void onDestroy(bool callScript);
int32 setViewRadius(int type);
DECLARE_PY_MOTHOD_ARG1(pySetViewRadius, int);
DECLARE_PY_MOTHOD_ARG0(pyprintRefCnt);
INLINE ENTITY_ID id() const
{
return id_;
}
INLINE void id(ENTITY_ID v)
{
id_ = v;
}
static PyObject* __pyget_pyGetID(Unit *self, void *closure)
{
return PyLong_FromLong(self->id());
}
public:
ENTITY_ID id_;
};
}
#endif // KBE_ENTITY_H