-
Notifications
You must be signed in to change notification settings - Fork 0
/
unsafe_entity.go
84 lines (68 loc) · 1.77 KB
/
unsafe_entity.go
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
package ec
import (
"git.golaxy.org/core/event"
"git.golaxy.org/core/util/iface"
"git.golaxy.org/core/util/uid"
"reflect"
)
// Deprecated: UnsafeEntity 访问实体内部函数
func UnsafeEntity(entity Entity) _UnsafeEntity {
return _UnsafeEntity{
Entity: entity,
}
}
type _UnsafeEntity struct {
Entity
}
// Init 初始化
func (ue _UnsafeEntity) Init(opts EntityOptions) {
ue.init(opts)
}
// GetOptions 获取实体所有选项
func (ue _UnsafeEntity) GetOptions() *EntityOptions {
return ue.getOptions()
}
// SetId 设置Id
func (ue _UnsafeEntity) SetId(id uid.Id) {
ue.setId(id)
}
// SetContext 设置上下文
func (ue _UnsafeEntity) SetContext(ctx iface.Cache) {
ue.setContext(ctx)
}
// GetVersion 获取组件列表变化版本号
func (ue _UnsafeEntity) GetVersion() int64 {
return ue.getVersion()
}
// SetState 设置状态
func (ue _UnsafeEntity) SetState(state EntityState) {
ue.setState(state)
}
// SetReflected 设置反射值
func (ue _UnsafeEntity) SetReflected(v reflect.Value) {
ue.setReflected(v)
}
// SetTreeNodeState 设置实体树节点状态
func (ue _UnsafeEntity) SetTreeNodeState(state TreeNodeState) {
ue.setTreeNodeState(state)
}
// SetTreeNodeParent 设置在实体树中的父实体
func (ue _UnsafeEntity) SetTreeNodeParent(parent Entity) {
ue.setTreeNodeParent(parent)
}
// EnterParentNode 进入父节点
func (ue _UnsafeEntity) EnterParentNode() {
ue.enterParentNode()
}
// LeaveParentNode 离开父节点
func (ue _UnsafeEntity) LeaveParentNode() {
ue.leaveParentNode()
}
// EventEntityDestroySelf 事件:实体销毁自身
func (ue _UnsafeEntity) EventEntityDestroySelf() event.IEvent {
return ue.eventEntityDestroySelf()
}
// CleanManagedHooks 清理所有的托管hook
func (ue _UnsafeEntity) CleanManagedHooks() {
ue.cleanManagedHooks()
}