-
Notifications
You must be signed in to change notification settings - Fork 0
/
glow.go
123 lines (109 loc) · 2.18 KB
/
glow.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
package rogue
//"fmt"
// TODO: Create a 'Hack' interface so glow, radar and whatever else can be
// held in the Engine object together
type GlowGroup struct {
Enabled bool
Active bool
Distance int
Color GlowColor
}
type GlowColor struct {
Red float64
Blue float64
Green float64
Opacity float64
}
type GlowHack struct {
Enabled bool
Active bool
Allies *GlowGroup
Enemies *GlowGroup
Weapons *GlowGroup
Items *GlowGroup
}
func InitGlowHack() *GlowHack {
// TODO: Load this data via YAML config
return &GlowHack{
Enabled: true,
Active: true,
Allies: &GlowGroup{
Enabled: false,
Active: false,
Distance: 9999,
Color: GlowColor{
Red: 0.8,
Blue: 0.3,
Green: 0.3,
Opacity: 0.6,
},
},
Enemies: &GlowGroup{
Enabled: true,
Active: true,
Distance: 500,
Color: GlowColor{
Red: 0.8,
Blue: 0.3,
Green: 0.3,
Opacity: 0.6,
},
},
Weapons: &GlowGroup{
Enabled: false,
Active: false,
Distance: 9999,
Color: GlowColor{
Red: 0.8,
Blue: 0.8,
Green: 0.8,
Opacity: 0.8,
},
},
Items: &GlowGroup{
Enabled: false,
Active: false,
Distance: 9999,
Color: GlowColor{
Red: 0.8,
Blue: 0.8,
Green: 0.8,
Opacity: 0.8,
},
},
}
}
func (self *GlowHack) Start() bool {
if self.Enabled {
self.Active = true
//TODO: Render objects
}
return self.Active
}
func (self *GlowHack) Stop() bool {
if self.Active {
self.Active = false
//TODO: Stop rendering glow objects
}
return self.Active
}
func (self *GlowHack) GlowObject(object *GameObject) {
// TODO: Render the object over the game display
}
func (self *GlowHack) GlowObjects(objects []*GameObject) {
for _, object := range objects {
self.GlowObject(object)
}
}
func (self *GlowHack) RemoveObjectGlow(object *GameObject) {
}
func (self *GlowHack) RemoveObjectsGlow(objects []*GameObject) {
for _, object := range objects {
self.RemoveObjectGlow(object)
}
}
func (self *GlowHack) Render() {
Info("Entering GlowHack.Render() function")
// TODO: This is where we would do actual rendering over display and itll
// be called from the primary one in Engine
}