-
Notifications
You must be signed in to change notification settings - Fork 0
/
zinc_LocalPosition2.go
executable file
·126 lines (105 loc) · 3.07 KB
/
zinc_LocalPosition2.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
// Package zinckit ...
// Generated by the zinc tool. DO NOT EDIT!
// Source: zinc_LocalPosition2
package zinckit
import (
"github.com/SirMetathyst/zinc"
)
// LocalPosition2Key ...
const LocalPosition2Key uint = 1388677675
// LocalPosition2Data ...
type LocalPosition2Data struct {
X float32
Y float32
}
// LocalPosition2Component ...
type LocalPosition2Component struct {
ctx zinc.CTX
data map[zinc.EntityID]LocalPosition2Data
}
// NewLocalPosition2Component ...
func NewLocalPosition2Component() *LocalPosition2Component {
return &LocalPosition2Component{
data: make(map[zinc.EntityID]LocalPosition2Data),
}
}
// SetContext ...
func (c *LocalPosition2Component) SetContext(ctx zinc.CTX) {
if c.ctx == nil {
c.ctx = ctx
}
}
func init() {
x := NewLocalPosition2Component()
ctx := zinc.Default().RegisterComponent(LocalPosition2Key, x)
x.SetContext(ctx)
}
// DeleteEntity ...
func (c *LocalPosition2Component) DeleteEntity(id zinc.EntityID) {
delete(c.data, id)
}
// HasEntity ...
func (c *LocalPosition2Component) HasEntity(id zinc.EntityID) bool {
_, ok := c.data[id]
return ok
}
// SetLocalPosition2 ...
func (c *LocalPosition2Component) SetLocalPosition2(id zinc.EntityID, localposition2 LocalPosition2Data) {
if c.ctx.HasEntity(id) {
if c.HasEntity(id) {
c.data[id] = localposition2
c.ctx.ComponentUpdated(LocalPosition2Key, id)
} else {
c.data[id] = localposition2
c.ctx.ComponentAdded(LocalPosition2Key, id)
}
}
}
// LocalPosition2 ...
func (c *LocalPosition2Component) LocalPosition2(id zinc.EntityID) LocalPosition2Data {
return c.data[id]
}
// DeleteLocalPosition2 ...
func (c *LocalPosition2Component) DeleteLocalPosition2(id zinc.EntityID) {
delete(c.data, id)
c.ctx.ComponentDeleted(LocalPosition2Key, id)
}
// SetLocalPosition2X ...
func SetLocalPosition2X(e *zinc.EntityManager, id zinc.EntityID, localposition2 LocalPosition2Data) {
v, _ := e.Component(LocalPosition2Key)
c := v.(*LocalPosition2Component)
c.SetLocalPosition2(id, localposition2)
}
// SetLocalPosition2 ...
func SetLocalPosition2(id zinc.EntityID, localposition2 LocalPosition2Data) {
SetLocalPosition2X(zinc.Default(), id, localposition2)
}
// LocalPosition2X ...
func LocalPosition2X(e *zinc.EntityManager, id zinc.EntityID) LocalPosition2Data {
v, _ := e.Component(LocalPosition2Key)
c := v.(*LocalPosition2Component)
return c.LocalPosition2(id)
}
// LocalPosition2 ...
func LocalPosition2(id zinc.EntityID) LocalPosition2Data {
return LocalPosition2X(zinc.Default(), id)
}
// DeleteLocalPosition2X ...
func DeleteLocalPosition2X(e *zinc.EntityManager, id zinc.EntityID) {
v, _ := e.Component(LocalPosition2Key)
c := v.(*LocalPosition2Component)
c.DeleteLocalPosition2(id)
}
// DeleteLocalPosition2 ...
func DeleteLocalPosition2(id zinc.EntityID) {
DeleteLocalPosition2X(zinc.Default(), id)
}
// HasLocalPosition2X ...
func HasLocalPosition2X(e *zinc.EntityManager, id zinc.EntityID) bool {
v, _ := e.Component(LocalPosition2Key)
return v.HasEntity(id)
}
// HasLocalPosition2 ...
func HasLocalPosition2(id zinc.EntityID) bool {
return HasLocalPosition2X(zinc.Default(), id)
}