-
Notifications
You must be signed in to change notification settings - Fork 0
/
entity_componentmgr_event_code.go
147 lines (124 loc) · 6.03 KB
/
entity_componentmgr_event_code.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// Code generated by eventcode gen_event; DO NOT EDIT.
package ec
import (
"fmt"
event "git.golaxy.org/core/event"
iface "git.golaxy.org/core/util/iface"
)
type iAutoEventComponentMgrAddComponents interface {
EventComponentMgrAddComponents() event.IEvent
}
func BindEventComponentMgrAddComponents(auto iAutoEventComponentMgrAddComponents, subscriber EventComponentMgrAddComponents, priority ...int32) event.Hook {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
return event.Bind[EventComponentMgrAddComponents](auto.EventComponentMgrAddComponents(), subscriber, priority...)
}
func _EmitEventComponentMgrAddComponents(auto iAutoEventComponentMgrAddComponents, entity Entity, components []Component) {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
event.UnsafeEvent(auto.EventComponentMgrAddComponents()).Emit(func(subscriber iface.Cache) bool {
iface.Cache2Iface[EventComponentMgrAddComponents](subscriber).OnComponentMgrAddComponents(entity, components)
return true
})
}
func _EmitEventComponentMgrAddComponentsWithInterrupt(auto iAutoEventComponentMgrAddComponents, interrupt func(entity Entity, components []Component) bool, entity Entity, components []Component) {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
event.UnsafeEvent(auto.EventComponentMgrAddComponents()).Emit(func(subscriber iface.Cache) bool {
if interrupt != nil {
if interrupt(entity, components) {
return false
}
}
iface.Cache2Iface[EventComponentMgrAddComponents](subscriber).OnComponentMgrAddComponents(entity, components)
return true
})
}
func HandleEventComponentMgrAddComponents(fun func(entity Entity, components []Component)) EventComponentMgrAddComponentsHandler {
return EventComponentMgrAddComponentsHandler(fun)
}
type EventComponentMgrAddComponentsHandler func(entity Entity, components []Component)
func (h EventComponentMgrAddComponentsHandler) OnComponentMgrAddComponents(entity Entity, components []Component) {
h(entity, components)
}
type iAutoEventComponentMgrRemoveComponent interface {
EventComponentMgrRemoveComponent() event.IEvent
}
func BindEventComponentMgrRemoveComponent(auto iAutoEventComponentMgrRemoveComponent, subscriber EventComponentMgrRemoveComponent, priority ...int32) event.Hook {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
return event.Bind[EventComponentMgrRemoveComponent](auto.EventComponentMgrRemoveComponent(), subscriber, priority...)
}
func _EmitEventComponentMgrRemoveComponent(auto iAutoEventComponentMgrRemoveComponent, entity Entity, component Component) {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
event.UnsafeEvent(auto.EventComponentMgrRemoveComponent()).Emit(func(subscriber iface.Cache) bool {
iface.Cache2Iface[EventComponentMgrRemoveComponent](subscriber).OnComponentMgrRemoveComponent(entity, component)
return true
})
}
func _EmitEventComponentMgrRemoveComponentWithInterrupt(auto iAutoEventComponentMgrRemoveComponent, interrupt func(entity Entity, component Component) bool, entity Entity, component Component) {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
event.UnsafeEvent(auto.EventComponentMgrRemoveComponent()).Emit(func(subscriber iface.Cache) bool {
if interrupt != nil {
if interrupt(entity, component) {
return false
}
}
iface.Cache2Iface[EventComponentMgrRemoveComponent](subscriber).OnComponentMgrRemoveComponent(entity, component)
return true
})
}
func HandleEventComponentMgrRemoveComponent(fun func(entity Entity, component Component)) EventComponentMgrRemoveComponentHandler {
return EventComponentMgrRemoveComponentHandler(fun)
}
type EventComponentMgrRemoveComponentHandler func(entity Entity, component Component)
func (h EventComponentMgrRemoveComponentHandler) OnComponentMgrRemoveComponent(entity Entity, component Component) {
h(entity, component)
}
type iAutoEventComponentMgrFirstAccessComponent interface {
EventComponentMgrFirstAccessComponent() event.IEvent
}
func BindEventComponentMgrFirstAccessComponent(auto iAutoEventComponentMgrFirstAccessComponent, subscriber EventComponentMgrFirstAccessComponent, priority ...int32) event.Hook {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
return event.Bind[EventComponentMgrFirstAccessComponent](auto.EventComponentMgrFirstAccessComponent(), subscriber, priority...)
}
func _EmitEventComponentMgrFirstAccessComponent(auto iAutoEventComponentMgrFirstAccessComponent, entity Entity, component Component) {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
event.UnsafeEvent(auto.EventComponentMgrFirstAccessComponent()).Emit(func(subscriber iface.Cache) bool {
iface.Cache2Iface[EventComponentMgrFirstAccessComponent](subscriber).OnComponentMgrFirstAccessComponent(entity, component)
return true
})
}
func _EmitEventComponentMgrFirstAccessComponentWithInterrupt(auto iAutoEventComponentMgrFirstAccessComponent, interrupt func(entity Entity, component Component) bool, entity Entity, component Component) {
if auto == nil {
panic(fmt.Errorf("%w: %w: auto is nil", event.ErrEvent, event.ErrArgs))
}
event.UnsafeEvent(auto.EventComponentMgrFirstAccessComponent()).Emit(func(subscriber iface.Cache) bool {
if interrupt != nil {
if interrupt(entity, component) {
return false
}
}
iface.Cache2Iface[EventComponentMgrFirstAccessComponent](subscriber).OnComponentMgrFirstAccessComponent(entity, component)
return true
})
}
func HandleEventComponentMgrFirstAccessComponent(fun func(entity Entity, component Component)) EventComponentMgrFirstAccessComponentHandler {
return EventComponentMgrFirstAccessComponentHandler(fun)
}
type EventComponentMgrFirstAccessComponentHandler func(entity Entity, component Component)
func (h EventComponentMgrFirstAccessComponentHandler) OnComponentMgrFirstAccessComponent(entity Entity, component Component) {
h(entity, component)
}