felflame 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.byebug_history +20 -0
- data/.gitignore +17 -0
- data/.inch.yml +11 -0
- data/.rspec +1 -0
- data/.rubocop.yml +13 -0
- data/.yardopts +13 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +11 -0
- data/Gemfile.lock +87 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +21 -0
- data/README.mdown +410 -0
- data/Rakefile +45 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/codeclimate/export-coverage.rb +16 -0
- data/deprecated/components/00_renderable.rb +19 -0
- data/deprecated/components/01_sprite.rb +57 -0
- data/deprecated/components/02_label.rb +32 -0
- data/deprecated/components/03_player_control.rb +26 -0
- data/deprecated/components/04_map.rb +21 -0
- data/deprecated/components/05_interactable.rb +16 -0
- data/deprecated/components/06_collidable.rb +22 -0
- data/deprecated/components/07_battle.rb +4 -0
- data/deprecated/components/07_indoor.rb +4 -0
- data/deprecated/components/07_overworld.rb +16 -0
- data/deprecated/components/debug_singleton.rb +13 -0
- data/deprecated/helpers/00_tileset.rb +56 -0
- data/deprecated/helpers/01_component.rb +74 -0
- data/deprecated/systems/00_update_levels.rb +34 -0
- data/deprecated/systems/10_player.rb +41 -0
- data/deprecated/systems/99_render.rb +37 -0
- data/docs/CNAME +1 -0
- data/docs/FelFlame.html +317 -0
- data/docs/FelFlame/ComponentManager.html +1627 -0
- data/docs/FelFlame/Components.html +423 -0
- data/docs/FelFlame/Entities.html +1054 -0
- data/docs/FelFlame/Helper.html +142 -0
- data/docs/FelFlame/Helper/ComponentManager.html +1627 -0
- data/docs/FelFlame/Scenes.html +761 -0
- data/docs/FelFlame/Stage.html +598 -0
- data/docs/FelFlame/Systems.html +1541 -0
- data/docs/_index.html +173 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +497 -0
- data/docs/file.README.html +498 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +498 -0
- data/docs/js/app.js +314 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +475 -0
- data/docs/top-level-namespace.html +137 -0
- data/felflame.gemspec +45 -0
- data/lib/felflame.rb +59 -0
- data/lib/felflame/component_manager.rb +245 -0
- data/lib/felflame/entity_manager.rb +135 -0
- data/lib/felflame/scene_manager.rb +58 -0
- data/lib/felflame/stage_manager.rb +70 -0
- data/lib/felflame/system_manager.rb +213 -0
- data/lib/felflame/version.rb +5 -0
- data/logos/felflame-logo-text.png +0 -0
- data/logos/felflame-logo-text.svg +172 -0
- data/logos/felflame-logo.png +0 -0
- data/logos/felflame-logo.svg +97 -0
- metadata +239 -0
@@ -0,0 +1,34 @@
|
|
1
|
+
class Systems
|
2
|
+
class UpdateLevels
|
3
|
+
@co = Components::Overworld
|
4
|
+
def self.run
|
5
|
+
@co.data[:add].each do |id|
|
6
|
+
@co.data[:add].delete(id)
|
7
|
+
if !(Components::Sprite.id & Entity.signatures[id]).zero?
|
8
|
+
@co.data[:grid][@co.data[id].x][@co.data[id].y] = {} if @co.data[:grid][@co.data[id].x][@co.data[id].y].nil?
|
9
|
+
#@co.data[:grid][@co.data[id].x][@co.data[id].y].merge!({ player: true })
|
10
|
+
puts @co.data[:grid][@co.data[id].x][@co.data[id].y].inspect
|
11
|
+
elsif !(Components::Map.id & Entity.signatures[id]).zero?
|
12
|
+
if Components::Map.data[id].json['tilesets'].last['source'].split('/').last.delete('\\').delete_suffix('.tsx') == 'hitbox'
|
13
|
+
Components::Map.data[id].json['layers'].each do |layer|
|
14
|
+
layer['chunks'].each do |chunk|
|
15
|
+
chunk['data'].each_slice(chunk['width']).with_index do |row, row_index|
|
16
|
+
row.each_with_index do |tile, column_index|
|
17
|
+
if tile.to_i == Components::Map.data[id].json['tilesets'].last['firstgid'].to_i
|
18
|
+
@co.data[:grid][column_index][row_index] = {} if @co.data[:grid][column_index][row_index].nil?
|
19
|
+
@co.data[:grid][column_index][row_index].merge!({ hitbox: true })
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
puts @co.data[:grid]
|
28
|
+
end
|
29
|
+
Components::Overworld.data[:remove].each do |id|
|
30
|
+
Components::Overworld.data[:remove].delete(id)
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
class Systems
|
2
|
+
class Player
|
3
|
+
@co = Components::Overworld
|
4
|
+
def self.run
|
5
|
+
Components::PlayerControl.data.each do |id, data|
|
6
|
+
puts6 "Right: #{@co.data[:grid][@co.data[id].x+1][@co.data[id].y]}"
|
7
|
+
puts6 "Left #{@co.data[:grid][@co.data[id].x-1][@co.data[id].y]}"
|
8
|
+
puts6 "Down #{@co.data[:grid][@co.data[id].x][@co.data[id].y+1]}"
|
9
|
+
puts6 "Up #{@co.data[:grid][@co.data[id].x][@co.data[id].y-1]}"
|
10
|
+
#puts6 @co.data[:grid][@co.data[id].x + 1][@co.data[id].y][:hitbox].nil?
|
11
|
+
|
12
|
+
if !(Components::Sprite.id & Entity.signatures[id]).zero?
|
13
|
+
if $gtk.args.inputs.keyboard.key_down.send(data.north) &&\
|
14
|
+
(@co.data[:grid][@co.data[id].x][@co.data[id].y - 1].nil? ||\
|
15
|
+
@co.data[:grid][@co.data[id].x][@co.data[id].y - 1][:hitbox].nil?)
|
16
|
+
Components::Sprite.data[id].y -= 64
|
17
|
+
@co.data[id].y -= 1
|
18
|
+
elsif $gtk.args.inputs.keyboard.key_down.send(data.south) &&\
|
19
|
+
(@co.data[:grid][@co.data[id].x][@co.data[id].y + 1].nil? ||\
|
20
|
+
@co.data[:grid][@co.data[id].x][@co.data[id].y + 1][:hitbox].nil?)
|
21
|
+
Components::Sprite.data[id].y += 64
|
22
|
+
@co.data[id].y += 1
|
23
|
+
elsif $gtk.args.inputs.keyboard.key_down.send(data.east) &&\
|
24
|
+
(@co.data[:grid][@co.data[id].x + 1][@co.data[id].y].nil? ||\
|
25
|
+
@co.data[:grid][@co.data[id].x + 1][@co.data[id].y][:hitbox].nil?)
|
26
|
+
Components::Sprite.data[id].x += 64
|
27
|
+
@co.data[id].x += 1
|
28
|
+
elsif $gtk.args.inputs.keyboard.key_down.send(data.west) &&\
|
29
|
+
(@co.data[:grid][@co.data[id].x - 1][@co.data[id].y].nil? || @co.data[:grid][@co.data[id].x - 1][@co.data[id].y][:hitbox].nil?)
|
30
|
+
Components::Sprite.data[id].x -= 64
|
31
|
+
@co.data[id].x -= 1
|
32
|
+
end
|
33
|
+
#Components::Sprite.data[id].y -= 64 if $gtk.args.inputs.keyboard.key_down.send(data.north)
|
34
|
+
#Components::Sprite.data[id].y += 64 if $gtk.args.inputs.keyboard.key_down.send(data.south)
|
35
|
+
#Components::Sprite.data[id].x += 64 if $gtk.args.inputs.keyboard.key_down.send(data.east)
|
36
|
+
#Components::Sprite.data[id].x -= 64 if $gtk.args.inputs.keyboard.key_down.send(data.west)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
class Systems
|
2
|
+
class Render
|
3
|
+
def self.run
|
4
|
+
Components::Renderable.data.sort_by { |v| v[1].z }.each do |key, data|
|
5
|
+
if !(Components::Sprite.id & Entity.signatures[key]).zero?
|
6
|
+
$gtk.args.outputs.sprites << Components::Sprite.data[key].set
|
7
|
+
elsif !(Components::Label.id & Entity.signatures[key]).zero?
|
8
|
+
$gtk.args.outputs.labels << Components::Label.data[key].set
|
9
|
+
elsif !(Components::Map.id & Entity.signatures[key]).zero?
|
10
|
+
Components::Map.data[key].json['layers'].each do |layer|
|
11
|
+
layer['chunks'].each do |chunk|
|
12
|
+
chunk['data'].each_slice(chunk['width']).with_index do |row, row_index|
|
13
|
+
row.each_with_index do |tile, column_index|
|
14
|
+
unless tile.zero?
|
15
|
+
iter = 0
|
16
|
+
loop do
|
17
|
+
tile = Helper.get_tile(json_name: Components::Map.data[key].json['tilesets'][iter]['source'].split('/').last.delete('\\').delete_suffix('.tsx'), tile_index: tile)
|
18
|
+
break if tile.is_a?(Hash)
|
19
|
+
raise Exception.new "#{Components::Map.data[key].json['json_name']} not valid map, exceeded tile range" if (iter += 1) >= Components::Map.data[key].json['tilesets'].count
|
20
|
+
end
|
21
|
+
unless tile.empty?
|
22
|
+
tile[:x] = Components::Map.data[key].x + (Components::Map.data[key].tilewidth * column_index) + chunk['x']
|
23
|
+
tile[:y] = Components::Map.data[key].y + (Components::Map.data[key].tileheight * row_index) + chunk['y']
|
24
|
+
tile[:w] = Components::Map.data[key].tilewidth
|
25
|
+
tile[:h] = Components::Map.data[key].tileheight
|
26
|
+
$gtk.args.outputs.sprites << tile
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/docs/CNAME
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
felflame.tradam.fyi
|
data/docs/FelFlame.html
ADDED
@@ -0,0 +1,317 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: FelFlame
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.26
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "FelFlame";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (F)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">FelFlame</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: FelFlame
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">FelFlame</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>felflame.rb<span class="defines">,<br />
|
98
|
+
system_manager.rb,<br /> component_manager.rb,<br /> entity_manager.rb,<br /> scene_manager.rb,<br /> stage_manager.rb</span>
|
99
|
+
</dd>
|
100
|
+
</dl>
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>The FelFlame namespace where all its functionality resides under.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div><h2>Defined Under Namespace</h2>
|
116
|
+
<p class="children">
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<strong class="classes">Classes:</strong> <span class='object_link'><a href="FelFlame/ComponentManager.html" title="FelFlame::ComponentManager (class)">ComponentManager</a></span>, <span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span>, <span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span>, <span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span>, <span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span>, <span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span>
|
122
|
+
|
123
|
+
|
124
|
+
</p>
|
125
|
+
|
126
|
+
|
127
|
+
<h2>
|
128
|
+
Constant Summary
|
129
|
+
<small><a href="#" class="constants_summary_toggle">collapse</a></small>
|
130
|
+
</h2>
|
131
|
+
|
132
|
+
<dl class="constants">
|
133
|
+
|
134
|
+
<dt id="Ent-constant" class="">Ent =
|
135
|
+
<div class="docstring">
|
136
|
+
<div class="discussion">
|
137
|
+
|
138
|
+
<p>An alias for <span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></p>
|
139
|
+
|
140
|
+
|
141
|
+
</div>
|
142
|
+
</div>
|
143
|
+
<div class="tags">
|
144
|
+
|
145
|
+
|
146
|
+
</div>
|
147
|
+
</dt>
|
148
|
+
<dd><pre class="code"><span class='const'>FelFlame</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span></pre></dd>
|
149
|
+
|
150
|
+
<dt id="Cmp-constant" class="">Cmp =
|
151
|
+
<div class="docstring">
|
152
|
+
<div class="discussion">
|
153
|
+
|
154
|
+
<p>An alias for <span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></p>
|
155
|
+
|
156
|
+
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
<div class="tags">
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
</dt>
|
164
|
+
<dd><pre class="code"><span class='const'>FelFlame</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Components.html" title="FelFlame::Components (class)">Components</a></span></span></pre></dd>
|
165
|
+
|
166
|
+
<dt id="Sys-constant" class="">Sys =
|
167
|
+
<div class="docstring">
|
168
|
+
<div class="discussion">
|
169
|
+
|
170
|
+
<p>An alias for <span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></p>
|
171
|
+
|
172
|
+
|
173
|
+
</div>
|
174
|
+
</div>
|
175
|
+
<div class="tags">
|
176
|
+
|
177
|
+
|
178
|
+
</div>
|
179
|
+
</dt>
|
180
|
+
<dd><pre class="code"><span class='const'>FelFlame</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Systems.html" title="FelFlame::Systems (class)">Systems</a></span></span></pre></dd>
|
181
|
+
|
182
|
+
<dt id="Sce-constant" class="">Sce =
|
183
|
+
<div class="docstring">
|
184
|
+
<div class="discussion">
|
185
|
+
|
186
|
+
<p>An alias for <span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></p>
|
187
|
+
|
188
|
+
|
189
|
+
</div>
|
190
|
+
</div>
|
191
|
+
<div class="tags">
|
192
|
+
|
193
|
+
|
194
|
+
</div>
|
195
|
+
</dt>
|
196
|
+
<dd><pre class="code"><span class='const'>FelFlame</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Scenes.html" title="FelFlame::Scenes (class)">Scenes</a></span></span></pre></dd>
|
197
|
+
|
198
|
+
<dt id="Stg-constant" class="">Stg =
|
199
|
+
<div class="docstring">
|
200
|
+
<div class="discussion">
|
201
|
+
|
202
|
+
<p>An alias for <span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></p>
|
203
|
+
|
204
|
+
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
<div class="tags">
|
208
|
+
|
209
|
+
|
210
|
+
</div>
|
211
|
+
</dt>
|
212
|
+
<dd><pre class="code"><span class='const'>FelFlame</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span></pre></dd>
|
213
|
+
|
214
|
+
</dl>
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
<h2>
|
225
|
+
Class Method Summary
|
226
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
227
|
+
</h2>
|
228
|
+
|
229
|
+
<ul class="summary">
|
230
|
+
|
231
|
+
<li class="public ">
|
232
|
+
<span class="summary_signature">
|
233
|
+
|
234
|
+
<a href="#call-class_method" title="call (class method)">.<strong>call</strong> ⇒ Object </a>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
</span>
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
<span class="summary_desc"><div class='inline'>
|
249
|
+
<p>An alias for <span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">Stage.call</a></span>.</p>
|
250
|
+
</div></span>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
</ul>
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
<div id="class_method_details" class="method_details_list">
|
261
|
+
<h2>Class Method Details</h2>
|
262
|
+
|
263
|
+
|
264
|
+
<div class="method_details first">
|
265
|
+
<h3 class="signature first" id="call-class_method">
|
266
|
+
|
267
|
+
.<strong>call</strong> ⇒ <tt>Object</tt>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
|
273
|
+
</h3><div class="docstring">
|
274
|
+
<div class="discussion">
|
275
|
+
|
276
|
+
<p>An alias for <span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">FelFlame::Stage.call</a></span>. It executes a single frame in the game.</p>
|
277
|
+
|
278
|
+
|
279
|
+
</div>
|
280
|
+
</div>
|
281
|
+
<div class="tags">
|
282
|
+
|
283
|
+
|
284
|
+
</div><table class="source_code">
|
285
|
+
<tr>
|
286
|
+
<td>
|
287
|
+
<pre class="lines">
|
288
|
+
|
289
|
+
|
290
|
+
13
|
291
|
+
14
|
292
|
+
15</pre>
|
293
|
+
</td>
|
294
|
+
<td>
|
295
|
+
<pre class="code"><span class="info file"># File 'felflame.rb', line 13</span>
|
296
|
+
|
297
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_call'>call</span>
|
298
|
+
<span class='const'><span class='object_link'><a href="" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="FelFlame/Stage.html" title="FelFlame::Stage (class)">Stage</a></span></span><span class='period'>.</span><span class='id identifier rubyid_call'><span class='object_link'><a href="FelFlame/Stage.html#call-class_method" title="FelFlame::Stage.call (method)">call</a></span></span>
|
299
|
+
<span class='kw'>end</span></pre>
|
300
|
+
</td>
|
301
|
+
</tr>
|
302
|
+
</table>
|
303
|
+
</div>
|
304
|
+
|
305
|
+
</div>
|
306
|
+
|
307
|
+
</div>
|
308
|
+
|
309
|
+
<div id="footer">
|
310
|
+
Generated on Fri Jul 9 01:56:53 2021 by
|
311
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
312
|
+
0.9.26 (ruby-2.7.3).
|
313
|
+
</div>
|
314
|
+
|
315
|
+
</div>
|
316
|
+
</body>
|
317
|
+
</html>
|
@@ -0,0 +1,1627 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: FelFlame::ComponentManager
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.26
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "FelFlame::ComponentManager";
|
19
|
+
relpath = '../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../_index.html">Index (C)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">ComponentManager</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: FelFlame::ComponentManager
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">FelFlame::ComponentManager</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>component_manager.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Component Managers are what is used to create individual components which can be attached to entities. When a Component is created from a Component Manager that has accessors given to it, you can set or get the values of those accessors using standard ruby message sending (e.g <tt>@component.var = 5</tt>), or by using the <span class='object_link'><a href="#attrs-instance_method" title="FelFlame::ComponentManager#attrs (method)">#attrs</a></span> and <span class='object_link'><a href="#update_attrs-instance_method" title="FelFlame::ComponentManager#update_attrs (method)">#update_attrs</a></span> methods instead.</p>
|
106
|
+
|
107
|
+
|
108
|
+
</div>
|
109
|
+
</div>
|
110
|
+
<div class="tags">
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
|
116
|
+
|
117
|
+
<h2>Class Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
118
|
+
<ul class="summary">
|
119
|
+
|
120
|
+
<li class="public ">
|
121
|
+
<span class="summary_signature">
|
122
|
+
|
123
|
+
<a href="#addition_triggers-class_method" title="addition_triggers (class method)">.<strong>addition_triggers</strong> ⇒ Array<System> </a>
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
</span>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
<span class="note title readonly">readonly</span>
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
143
|
+
<p>Stores references to systems that should be triggered when this component is added to an enitity.</p>
|
144
|
+
</div></span>
|
145
|
+
|
146
|
+
</li>
|
147
|
+
|
148
|
+
|
149
|
+
<li class="public ">
|
150
|
+
<span class="summary_signature">
|
151
|
+
|
152
|
+
<a href="#attr_triggers-class_method" title="attr_triggers (class method)">.<strong>attr_triggers</strong> ⇒ Hash<Symbol, System> </a>
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
</span>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
<span class="note title readonly">readonly</span>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
<span class="summary_desc"><div class='inline'>
|
172
|
+
<p>Stores references to systems that should be triggered when an attribute from this component changed.</p>
|
173
|
+
</div></span>
|
174
|
+
|
175
|
+
</li>
|
176
|
+
|
177
|
+
|
178
|
+
<li class="public ">
|
179
|
+
<span class="summary_signature">
|
180
|
+
|
181
|
+
<a href="#removal_triggers-class_method" title="removal_triggers (class method)">.<strong>removal_triggers</strong> ⇒ Array<System> </a>
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
</span>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
<span class="note title readonly">readonly</span>
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
<span class="summary_desc"><div class='inline'>
|
201
|
+
<p>Stores references to systems that should be triggered when this component is removed from an enitity.</p>
|
202
|
+
</div></span>
|
203
|
+
|
204
|
+
</li>
|
205
|
+
|
206
|
+
|
207
|
+
</ul>
|
208
|
+
|
209
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
210
|
+
<ul class="summary">
|
211
|
+
|
212
|
+
<li class="public ">
|
213
|
+
<span class="summary_signature">
|
214
|
+
|
215
|
+
<a href="#addition_triggers-instance_method" title="#addition_triggers (instance method)">#<strong>addition_triggers</strong> ⇒ Array<System> </a>
|
216
|
+
|
217
|
+
|
218
|
+
|
219
|
+
</span>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
<span class="note title readonly">readonly</span>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
<span class="summary_desc"><div class='inline'>
|
235
|
+
<p>Stores references to systems that should be triggered when a component from this manager is added.</p>
|
236
|
+
</div></span>
|
237
|
+
|
238
|
+
</li>
|
239
|
+
|
240
|
+
|
241
|
+
<li class="public ">
|
242
|
+
<span class="summary_signature">
|
243
|
+
|
244
|
+
<a href="#attr_triggers-instance_method" title="#attr_triggers (instance method)">#<strong>attr_triggers</strong> ⇒ Hash<Symbol, Array<System>> </a>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
</span>
|
249
|
+
|
250
|
+
|
251
|
+
|
252
|
+
|
253
|
+
<span class="note title readonly">readonly</span>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
<span class="summary_desc"><div class='inline'>
|
264
|
+
<p>Stores references to systems that should be triggered when an attribute from this manager is changed.</p>
|
265
|
+
</div></span>
|
266
|
+
|
267
|
+
</li>
|
268
|
+
|
269
|
+
|
270
|
+
<li class="public ">
|
271
|
+
<span class="summary_signature">
|
272
|
+
|
273
|
+
<a href="#id-instance_method" title="#id (instance method)">#<strong>id</strong> ⇒ Integer </a>
|
274
|
+
|
275
|
+
|
276
|
+
|
277
|
+
</span>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
<span class="note title readonly">readonly</span>
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
<span class="summary_desc"><div class='inline'>
|
293
|
+
<p>Holds the <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">unique ID</a></span> of a component.</p>
|
294
|
+
</div></span>
|
295
|
+
|
296
|
+
</li>
|
297
|
+
|
298
|
+
|
299
|
+
<li class="public ">
|
300
|
+
<span class="summary_signature">
|
301
|
+
|
302
|
+
<a href="#removal_triggers-instance_method" title="#removal_triggers (instance method)">#<strong>removal_triggers</strong> ⇒ Array<System> </a>
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
</span>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
|
311
|
+
<span class="note title readonly">readonly</span>
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
|
319
|
+
|
320
|
+
|
321
|
+
<span class="summary_desc"><div class='inline'>
|
322
|
+
<p>Stores references to systems that should be triggered when a component from this manager is removed.</p>
|
323
|
+
</div></span>
|
324
|
+
|
325
|
+
</li>
|
326
|
+
|
327
|
+
|
328
|
+
</ul>
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
<h2>
|
335
|
+
Class Method Summary
|
336
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
337
|
+
</h2>
|
338
|
+
|
339
|
+
<ul class="summary">
|
340
|
+
|
341
|
+
<li class="public ">
|
342
|
+
<span class="summary_signature">
|
343
|
+
|
344
|
+
<a href="#[]-class_method" title="[] (class method)">.<strong>[]</strong>(component_id) ⇒ Component </a>
|
345
|
+
|
346
|
+
|
347
|
+
|
348
|
+
</span>
|
349
|
+
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
<span class="summary_desc"><div class='inline'>
|
359
|
+
<p>Gets a Component from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">unique ID</a></span>.</p>
|
360
|
+
</div></span>
|
361
|
+
|
362
|
+
</li>
|
363
|
+
|
364
|
+
|
365
|
+
<li class="public ">
|
366
|
+
<span class="summary_signature">
|
367
|
+
|
368
|
+
<a href="#each-class_method" title="each (class method)">.<strong>each</strong>(&block) ⇒ Enumerator </a>
|
369
|
+
|
370
|
+
|
371
|
+
|
372
|
+
</span>
|
373
|
+
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
<span class="summary_desc"><div class='inline'>
|
383
|
+
<p>Iterates over all components within the component manager.</p>
|
384
|
+
</div></span>
|
385
|
+
|
386
|
+
</li>
|
387
|
+
|
388
|
+
|
389
|
+
</ul>
|
390
|
+
|
391
|
+
<h2>
|
392
|
+
Instance Method Summary
|
393
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
394
|
+
</h2>
|
395
|
+
|
396
|
+
<ul class="summary">
|
397
|
+
|
398
|
+
<li class="public ">
|
399
|
+
<span class="summary_signature">
|
400
|
+
|
401
|
+
<a href="#attr_changed_trigger_systems-instance_method" title="#attr_changed_trigger_systems (instance method)">#<strong>attr_changed_trigger_systems</strong>(attr) ⇒ Boolean </a>
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
</span>
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
|
413
|
+
|
414
|
+
|
415
|
+
<span class="summary_desc"><div class='inline'>
|
416
|
+
<p>Execute systems that have been added to execute on variable change.</p>
|
417
|
+
</div></span>
|
418
|
+
|
419
|
+
</li>
|
420
|
+
|
421
|
+
|
422
|
+
<li class="public ">
|
423
|
+
<span class="summary_signature">
|
424
|
+
|
425
|
+
<a href="#attrs-instance_method" title="#attrs (instance method)">#<strong>attrs</strong> ⇒ Hash<Symbol, Value> </a>
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
</span>
|
430
|
+
|
431
|
+
|
432
|
+
|
433
|
+
|
434
|
+
|
435
|
+
|
436
|
+
|
437
|
+
|
438
|
+
|
439
|
+
<span class="summary_desc"><div class='inline'>
|
440
|
+
<p>A hash, where all the keys are attributes linked to their respective values.</p>
|
441
|
+
</div></span>
|
442
|
+
|
443
|
+
</li>
|
444
|
+
|
445
|
+
|
446
|
+
<li class="public ">
|
447
|
+
<span class="summary_signature">
|
448
|
+
|
449
|
+
<a href="#delete-instance_method" title="#delete (instance method)">#<strong>delete</strong> ⇒ Boolean </a>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
</span>
|
454
|
+
|
455
|
+
|
456
|
+
|
457
|
+
|
458
|
+
|
459
|
+
|
460
|
+
|
461
|
+
|
462
|
+
|
463
|
+
<span class="summary_desc"><div class='inline'>
|
464
|
+
<p>Removes this component from the list and purges all references to this Component from other Entities, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span> and data.</p>
|
465
|
+
</div></span>
|
466
|
+
|
467
|
+
</li>
|
468
|
+
|
469
|
+
|
470
|
+
<li class="public ">
|
471
|
+
<span class="summary_signature">
|
472
|
+
|
473
|
+
<a href="#entities-instance_method" title="#entities (instance method)">#<strong>entities</strong> ⇒ Array<Integer> </a>
|
474
|
+
|
475
|
+
|
476
|
+
|
477
|
+
</span>
|
478
|
+
|
479
|
+
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
|
486
|
+
|
487
|
+
<span class="summary_desc"><div class='inline'>
|
488
|
+
<p>A list of entity ids that are linked to the component.</p>
|
489
|
+
</div></span>
|
490
|
+
|
491
|
+
</li>
|
492
|
+
|
493
|
+
|
494
|
+
<li class="public ">
|
495
|
+
<span class="summary_signature">
|
496
|
+
|
497
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(**attrs) ⇒ Component </a>
|
498
|
+
|
499
|
+
|
500
|
+
|
501
|
+
</span>
|
502
|
+
|
503
|
+
|
504
|
+
<span class="note title constructor">constructor</span>
|
505
|
+
|
506
|
+
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
<span class="summary_desc"><div class='inline'>
|
514
|
+
<p>Creates a new component and sets the values of the attributes given to it.</p>
|
515
|
+
</div></span>
|
516
|
+
|
517
|
+
</li>
|
518
|
+
|
519
|
+
|
520
|
+
<li class="public ">
|
521
|
+
<span class="summary_signature">
|
522
|
+
|
523
|
+
<a href="#to_i-instance_method" title="#to_i (instance method)">#<strong>to_i</strong> ⇒ Integer </a>
|
524
|
+
|
525
|
+
|
526
|
+
|
527
|
+
</span>
|
528
|
+
|
529
|
+
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
|
534
|
+
|
535
|
+
|
536
|
+
|
537
|
+
<span class="summary_desc"><div class='inline'>
|
538
|
+
<p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID Reader</a></span>.</p>
|
539
|
+
</div></span>
|
540
|
+
|
541
|
+
</li>
|
542
|
+
|
543
|
+
|
544
|
+
<li class="public ">
|
545
|
+
<span class="summary_signature">
|
546
|
+
|
547
|
+
<a href="#update_attrs-instance_method" title="#update_attrs (instance method)">#<strong>update_attrs</strong>(**opts) ⇒ Hash<Symbol, Value> </a>
|
548
|
+
|
549
|
+
|
550
|
+
|
551
|
+
</span>
|
552
|
+
|
553
|
+
|
554
|
+
|
555
|
+
|
556
|
+
|
557
|
+
|
558
|
+
|
559
|
+
|
560
|
+
|
561
|
+
<span class="summary_desc"><div class='inline'>
|
562
|
+
<p>Update attribute values using a hash or keywords.</p>
|
563
|
+
</div></span>
|
564
|
+
|
565
|
+
</li>
|
566
|
+
|
567
|
+
|
568
|
+
</ul>
|
569
|
+
|
570
|
+
|
571
|
+
<div id="constructor_details" class="method_details_list">
|
572
|
+
<h2>Constructor Details</h2>
|
573
|
+
|
574
|
+
<div class="method_details first">
|
575
|
+
<h3 class="signature first" id="initialize-instance_method">
|
576
|
+
|
577
|
+
#<strong>initialize</strong>(**attrs) ⇒ <tt>Component</tt>
|
578
|
+
|
579
|
+
|
580
|
+
|
581
|
+
|
582
|
+
|
583
|
+
</h3><div class="docstring">
|
584
|
+
<div class="discussion">
|
585
|
+
|
586
|
+
<p>Creates a new component and sets the values of the attributes given to it. If an attritbute is not passed then it will remain as the default.</p>
|
587
|
+
|
588
|
+
|
589
|
+
</div>
|
590
|
+
</div>
|
591
|
+
<div class="tags">
|
592
|
+
<p class="tag_title">Parameters:</p>
|
593
|
+
<ul class="param">
|
594
|
+
|
595
|
+
<li>
|
596
|
+
|
597
|
+
<span class='name'>attrs</span>
|
598
|
+
|
599
|
+
|
600
|
+
<span class='type'>(<tt>Keyword: Value</tt>)</span>
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
—
|
605
|
+
<div class='inline'>
|
606
|
+
<p>You can pass any number of Keyword-Value pairs</p>
|
607
|
+
</div>
|
608
|
+
|
609
|
+
</li>
|
610
|
+
|
611
|
+
</ul>
|
612
|
+
|
613
|
+
|
614
|
+
</div><table class="source_code">
|
615
|
+
<tr>
|
616
|
+
<td>
|
617
|
+
<pre class="lines">
|
618
|
+
|
619
|
+
|
620
|
+
100
|
621
|
+
101
|
622
|
+
102
|
623
|
+
103
|
624
|
+
104
|
625
|
+
105
|
626
|
+
106
|
627
|
+
107
|
628
|
+
108
|
629
|
+
109
|
630
|
+
110
|
631
|
+
111
|
632
|
+
112
|
633
|
+
113
|
634
|
+
114
|
635
|
+
115
|
636
|
+
116
|
637
|
+
117
|
638
|
+
118</pre>
|
639
|
+
</td>
|
640
|
+
<td>
|
641
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 100</span>
|
642
|
+
|
643
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_attrs'>attrs</span><span class='rparen'>)</span>
|
644
|
+
<span class='comment'># Prepare the object
|
645
|
+
</span> <span class='comment'># (this is a function created with metaprogramming
|
646
|
+
</span> <span class='comment'># in FelFlame::Components
|
647
|
+
</span> <span class='id identifier rubyid_set_defaults'>set_defaults</span>
|
648
|
+
|
649
|
+
<span class='comment'># Generate ID
|
650
|
+
</span> <span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_find_index'>find_index</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_i'>i</span><span class='op'>|</span> <span class='id identifier rubyid_i'>i</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span> <span class='rbrace'>}</span>
|
651
|
+
<span class='id identifier rubyid_new_id'>new_id</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_size'>size</span> <span class='kw'>if</span> <span class='id identifier rubyid_new_id'>new_id</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
652
|
+
<span class='ivar'>@id</span> <span class='op'>=</span> <span class='id identifier rubyid_new_id'>new_id</span>
|
653
|
+
|
654
|
+
<span class='comment'># Fill params
|
655
|
+
</span> <span class='id identifier rubyid_attrs'>attrs</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
656
|
+
<span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span>
|
657
|
+
<span class='kw'>end</span>
|
658
|
+
|
659
|
+
<span class='comment'># Save Component
|
660
|
+
</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_new_id'>new_id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>self</span>
|
661
|
+
<span class='kw'>end</span></pre>
|
662
|
+
</td>
|
663
|
+
</tr>
|
664
|
+
</table>
|
665
|
+
</div>
|
666
|
+
|
667
|
+
</div>
|
668
|
+
|
669
|
+
<div id="class_attr_details" class="attr_details">
|
670
|
+
<h2>Class Attribute Details</h2>
|
671
|
+
|
672
|
+
|
673
|
+
<span id="addition_triggers=-class_method"></span>
|
674
|
+
<div class="method_details first">
|
675
|
+
<h3 class="signature first" id="addition_triggers-class_method">
|
676
|
+
|
677
|
+
.<strong>addition_triggers</strong> ⇒ <tt>Array<System></tt>
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
|
682
|
+
|
683
|
+
</h3><div class="docstring">
|
684
|
+
<div class="discussion">
|
685
|
+
|
686
|
+
<p>Stores references to systems that should be triggered when this component is added to an enitity. Do not edit this array as it is managed by FelFlame automatically.</p>
|
687
|
+
|
688
|
+
|
689
|
+
</div>
|
690
|
+
</div>
|
691
|
+
<div class="tags">
|
692
|
+
|
693
|
+
<p class="tag_title">Returns:</p>
|
694
|
+
<ul class="return">
|
695
|
+
|
696
|
+
<li>
|
697
|
+
|
698
|
+
|
699
|
+
<span class='type'>(<tt>Array<System></tt>)</span>
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
</li>
|
704
|
+
|
705
|
+
</ul>
|
706
|
+
|
707
|
+
</div><table class="source_code">
|
708
|
+
<tr>
|
709
|
+
<td>
|
710
|
+
<pre class="lines">
|
711
|
+
|
712
|
+
|
713
|
+
132
|
714
|
+
133
|
715
|
+
134</pre>
|
716
|
+
</td>
|
717
|
+
<td>
|
718
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 132</span>
|
719
|
+
|
720
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span>
|
721
|
+
<span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
722
|
+
<span class='kw'>end</span></pre>
|
723
|
+
</td>
|
724
|
+
</tr>
|
725
|
+
</table>
|
726
|
+
</div>
|
727
|
+
|
728
|
+
|
729
|
+
<span id="attr_triggers=-class_method"></span>
|
730
|
+
<div class="method_details ">
|
731
|
+
<h3 class="signature " id="attr_triggers-class_method">
|
732
|
+
|
733
|
+
.<strong>attr_triggers</strong> ⇒ <tt>Hash<Symbol, System></tt>
|
734
|
+
|
735
|
+
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
</h3><div class="docstring">
|
740
|
+
<div class="discussion">
|
741
|
+
|
742
|
+
<p>Stores references to systems that should be triggered when an attribute from this component changed. Do not edit this hash as it is managed by FelFlame automatically.</p>
|
743
|
+
|
744
|
+
|
745
|
+
</div>
|
746
|
+
</div>
|
747
|
+
<div class="tags">
|
748
|
+
|
749
|
+
<p class="tag_title">Returns:</p>
|
750
|
+
<ul class="return">
|
751
|
+
|
752
|
+
<li>
|
753
|
+
|
754
|
+
|
755
|
+
<span class='type'>(<tt>Hash<Symbol, System></tt>)</span>
|
756
|
+
|
757
|
+
|
758
|
+
|
759
|
+
</li>
|
760
|
+
|
761
|
+
</ul>
|
762
|
+
|
763
|
+
</div><table class="source_code">
|
764
|
+
<tr>
|
765
|
+
<td>
|
766
|
+
<pre class="lines">
|
767
|
+
|
768
|
+
|
769
|
+
148
|
770
|
+
149
|
771
|
+
150</pre>
|
772
|
+
</td>
|
773
|
+
<td>
|
774
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 148</span>
|
775
|
+
|
776
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span>
|
777
|
+
<span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
778
|
+
<span class='kw'>end</span></pre>
|
779
|
+
</td>
|
780
|
+
</tr>
|
781
|
+
</table>
|
782
|
+
</div>
|
783
|
+
|
784
|
+
|
785
|
+
<span id="removal_triggers=-class_method"></span>
|
786
|
+
<div class="method_details ">
|
787
|
+
<h3 class="signature " id="removal_triggers-class_method">
|
788
|
+
|
789
|
+
.<strong>removal_triggers</strong> ⇒ <tt>Array<System></tt>
|
790
|
+
|
791
|
+
|
792
|
+
|
793
|
+
|
794
|
+
|
795
|
+
</h3><div class="docstring">
|
796
|
+
<div class="discussion">
|
797
|
+
|
798
|
+
<p>Stores references to systems that should be triggered when this component is removed from an enitity. Do not edit this array as it is managed by FelFlame automatically.</p>
|
799
|
+
|
800
|
+
|
801
|
+
</div>
|
802
|
+
</div>
|
803
|
+
<div class="tags">
|
804
|
+
|
805
|
+
<p class="tag_title">Returns:</p>
|
806
|
+
<ul class="return">
|
807
|
+
|
808
|
+
<li>
|
809
|
+
|
810
|
+
|
811
|
+
<span class='type'>(<tt>Array<System></tt>)</span>
|
812
|
+
|
813
|
+
|
814
|
+
|
815
|
+
</li>
|
816
|
+
|
817
|
+
</ul>
|
818
|
+
|
819
|
+
</div><table class="source_code">
|
820
|
+
<tr>
|
821
|
+
<td>
|
822
|
+
<pre class="lines">
|
823
|
+
|
824
|
+
|
825
|
+
140
|
826
|
+
141
|
827
|
+
142</pre>
|
828
|
+
</td>
|
829
|
+
<td>
|
830
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 140</span>
|
831
|
+
|
832
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span>
|
833
|
+
<span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
834
|
+
<span class='kw'>end</span></pre>
|
835
|
+
</td>
|
836
|
+
</tr>
|
837
|
+
</table>
|
838
|
+
</div>
|
839
|
+
|
840
|
+
</div>
|
841
|
+
|
842
|
+
<div id="instance_attr_details" class="attr_details">
|
843
|
+
<h2>Instance Attribute Details</h2>
|
844
|
+
|
845
|
+
|
846
|
+
<span id="addition_triggers=-instance_method"></span>
|
847
|
+
<div class="method_details first">
|
848
|
+
<h3 class="signature first" id="addition_triggers-instance_method">
|
849
|
+
|
850
|
+
#<strong>addition_triggers</strong> ⇒ <tt>Array<System></tt>
|
851
|
+
|
852
|
+
|
853
|
+
|
854
|
+
|
855
|
+
|
856
|
+
</h3><div class="docstring">
|
857
|
+
<div class="discussion">
|
858
|
+
|
859
|
+
<p>Stores references to systems that should be triggered when a component from this manager is added. Do not edit this array as it is managed by FelFlame automatically.</p>
|
860
|
+
|
861
|
+
|
862
|
+
</div>
|
863
|
+
</div>
|
864
|
+
<div class="tags">
|
865
|
+
|
866
|
+
<p class="tag_title">Returns:</p>
|
867
|
+
<ul class="return">
|
868
|
+
|
869
|
+
<li>
|
870
|
+
|
871
|
+
|
872
|
+
<span class='type'>(<tt>Array<System></tt>)</span>
|
873
|
+
|
874
|
+
|
875
|
+
|
876
|
+
</li>
|
877
|
+
|
878
|
+
</ul>
|
879
|
+
|
880
|
+
</div><table class="source_code">
|
881
|
+
<tr>
|
882
|
+
<td>
|
883
|
+
<pre class="lines">
|
884
|
+
|
885
|
+
|
886
|
+
77
|
887
|
+
78
|
888
|
+
79</pre>
|
889
|
+
</td>
|
890
|
+
<td>
|
891
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 77</span>
|
892
|
+
|
893
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_addition_triggers'>addition_triggers</span>
|
894
|
+
<span class='ivar'>@addition_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
895
|
+
<span class='kw'>end</span></pre>
|
896
|
+
</td>
|
897
|
+
</tr>
|
898
|
+
</table>
|
899
|
+
</div>
|
900
|
+
|
901
|
+
|
902
|
+
<span id="attr_triggers=-instance_method"></span>
|
903
|
+
<div class="method_details ">
|
904
|
+
<h3 class="signature " id="attr_triggers-instance_method">
|
905
|
+
|
906
|
+
#<strong>attr_triggers</strong> ⇒ <tt>Hash<Symbol, Array<System>></tt>
|
907
|
+
|
908
|
+
|
909
|
+
|
910
|
+
|
911
|
+
|
912
|
+
</h3><div class="docstring">
|
913
|
+
<div class="discussion">
|
914
|
+
|
915
|
+
<p>Stores references to systems that should be triggered when an attribute from this manager is changed. Do not edit this hash as it is managed by FelFlame automatically.</p>
|
916
|
+
|
917
|
+
|
918
|
+
</div>
|
919
|
+
</div>
|
920
|
+
<div class="tags">
|
921
|
+
|
922
|
+
<p class="tag_title">Returns:</p>
|
923
|
+
<ul class="return">
|
924
|
+
|
925
|
+
<li>
|
926
|
+
|
927
|
+
|
928
|
+
<span class='type'>(<tt>Hash<Symbol, Array<System>></tt>)</span>
|
929
|
+
|
930
|
+
|
931
|
+
|
932
|
+
</li>
|
933
|
+
|
934
|
+
</ul>
|
935
|
+
|
936
|
+
</div><table class="source_code">
|
937
|
+
<tr>
|
938
|
+
<td>
|
939
|
+
<pre class="lines">
|
940
|
+
|
941
|
+
|
942
|
+
93
|
943
|
+
94
|
944
|
+
95</pre>
|
945
|
+
</td>
|
946
|
+
<td>
|
947
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 93</span>
|
948
|
+
|
949
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span>
|
950
|
+
<span class='ivar'>@attr_triggers</span> <span class='op'>||=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span>
|
951
|
+
<span class='kw'>end</span></pre>
|
952
|
+
</td>
|
953
|
+
</tr>
|
954
|
+
</table>
|
955
|
+
</div>
|
956
|
+
|
957
|
+
|
958
|
+
<span id="id=-instance_method"></span>
|
959
|
+
<div class="method_details ">
|
960
|
+
<h3 class="signature " id="id-instance_method">
|
961
|
+
|
962
|
+
#<strong>id</strong> ⇒ <tt>Integer</tt>
|
963
|
+
|
964
|
+
|
965
|
+
|
966
|
+
|
967
|
+
|
968
|
+
</h3><div class="docstring">
|
969
|
+
<div class="discussion">
|
970
|
+
|
971
|
+
<p>Holds the <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">unique ID</a></span> of a component. The <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span> is only unique within the scope of the component manager it was created from.</p>
|
972
|
+
|
973
|
+
|
974
|
+
</div>
|
975
|
+
</div>
|
976
|
+
<div class="tags">
|
977
|
+
|
978
|
+
<p class="tag_title">Returns:</p>
|
979
|
+
<ul class="return">
|
980
|
+
|
981
|
+
<li>
|
982
|
+
|
983
|
+
|
984
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
985
|
+
|
986
|
+
|
987
|
+
|
988
|
+
</li>
|
989
|
+
|
990
|
+
</ul>
|
991
|
+
|
992
|
+
</div><table class="source_code">
|
993
|
+
<tr>
|
994
|
+
<td>
|
995
|
+
<pre class="lines">
|
996
|
+
|
997
|
+
|
998
|
+
59
|
999
|
+
60
|
1000
|
+
61</pre>
|
1001
|
+
</td>
|
1002
|
+
<td>
|
1003
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 59</span>
|
1004
|
+
|
1005
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_id'>id</span>
|
1006
|
+
<span class='ivar'>@id</span>
|
1007
|
+
<span class='kw'>end</span></pre>
|
1008
|
+
</td>
|
1009
|
+
</tr>
|
1010
|
+
</table>
|
1011
|
+
</div>
|
1012
|
+
|
1013
|
+
|
1014
|
+
<span id="removal_triggers=-instance_method"></span>
|
1015
|
+
<div class="method_details ">
|
1016
|
+
<h3 class="signature " id="removal_triggers-instance_method">
|
1017
|
+
|
1018
|
+
#<strong>removal_triggers</strong> ⇒ <tt>Array<System></tt>
|
1019
|
+
|
1020
|
+
|
1021
|
+
|
1022
|
+
|
1023
|
+
|
1024
|
+
</h3><div class="docstring">
|
1025
|
+
<div class="discussion">
|
1026
|
+
|
1027
|
+
<p>Stores references to systems that should be triggered when a component from this manager is removed. Do not edit this array as it is managed by FelFlame automatically.</p>
|
1028
|
+
|
1029
|
+
|
1030
|
+
</div>
|
1031
|
+
</div>
|
1032
|
+
<div class="tags">
|
1033
|
+
|
1034
|
+
<p class="tag_title">Returns:</p>
|
1035
|
+
<ul class="return">
|
1036
|
+
|
1037
|
+
<li>
|
1038
|
+
|
1039
|
+
|
1040
|
+
<span class='type'>(<tt>Array<System></tt>)</span>
|
1041
|
+
|
1042
|
+
|
1043
|
+
|
1044
|
+
</li>
|
1045
|
+
|
1046
|
+
</ul>
|
1047
|
+
|
1048
|
+
</div><table class="source_code">
|
1049
|
+
<tr>
|
1050
|
+
<td>
|
1051
|
+
<pre class="lines">
|
1052
|
+
|
1053
|
+
|
1054
|
+
85
|
1055
|
+
86
|
1056
|
+
87</pre>
|
1057
|
+
</td>
|
1058
|
+
<td>
|
1059
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 85</span>
|
1060
|
+
|
1061
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_removal_triggers'>removal_triggers</span>
|
1062
|
+
<span class='ivar'>@removal_triggers</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1063
|
+
<span class='kw'>end</span></pre>
|
1064
|
+
</td>
|
1065
|
+
</tr>
|
1066
|
+
</table>
|
1067
|
+
</div>
|
1068
|
+
|
1069
|
+
</div>
|
1070
|
+
|
1071
|
+
|
1072
|
+
<div id="class_method_details" class="method_details_list">
|
1073
|
+
<h2>Class Method Details</h2>
|
1074
|
+
|
1075
|
+
|
1076
|
+
<div class="method_details first">
|
1077
|
+
<h3 class="signature first" id="[]-class_method">
|
1078
|
+
|
1079
|
+
.<strong>[]</strong>(component_id) ⇒ <tt>Component</tt>
|
1080
|
+
|
1081
|
+
|
1082
|
+
|
1083
|
+
|
1084
|
+
|
1085
|
+
</h3><div class="docstring">
|
1086
|
+
<div class="discussion">
|
1087
|
+
|
1088
|
+
<p>Gets a Component from the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">unique ID</a></span>. Usage is simular to how an Array lookup works.</p>
|
1089
|
+
|
1090
|
+
|
1091
|
+
</div>
|
1092
|
+
</div>
|
1093
|
+
<div class="tags">
|
1094
|
+
|
1095
|
+
<div class="examples">
|
1096
|
+
<p class="tag_title">Examples:</p>
|
1097
|
+
|
1098
|
+
|
1099
|
+
<pre class="example code"><code><span class='comment'># this gets the 'Health' Component with ID 7
|
1100
|
+
</span><span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Components.html" title="FelFlame::Components (class)">Components</a></span></span><span class='op'>::</span><span class='const'>Health</span><span class='lbracket'>[</span><span class='int'>7</span><span class='rbracket'>]</span></code></pre>
|
1101
|
+
|
1102
|
+
</div>
|
1103
|
+
<p class="tag_title">Parameters:</p>
|
1104
|
+
<ul class="param">
|
1105
|
+
|
1106
|
+
<li>
|
1107
|
+
|
1108
|
+
<span class='name'>component_id</span>
|
1109
|
+
|
1110
|
+
|
1111
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1112
|
+
|
1113
|
+
|
1114
|
+
|
1115
|
+
</li>
|
1116
|
+
|
1117
|
+
</ul>
|
1118
|
+
|
1119
|
+
<p class="tag_title">Returns:</p>
|
1120
|
+
<ul class="return">
|
1121
|
+
|
1122
|
+
<li>
|
1123
|
+
|
1124
|
+
|
1125
|
+
<span class='type'>(<tt>Component</tt>)</span>
|
1126
|
+
|
1127
|
+
|
1128
|
+
|
1129
|
+
—
|
1130
|
+
<div class='inline'>
|
1131
|
+
<p>Returns the Component that uses the given unique <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span>, nil if there is no Component associated with the given <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span></p>
|
1132
|
+
</div>
|
1133
|
+
|
1134
|
+
</li>
|
1135
|
+
|
1136
|
+
</ul>
|
1137
|
+
|
1138
|
+
</div><table class="source_code">
|
1139
|
+
<tr>
|
1140
|
+
<td>
|
1141
|
+
<pre class="lines">
|
1142
|
+
|
1143
|
+
|
1144
|
+
165
|
1145
|
+
166
|
1146
|
+
167</pre>
|
1147
|
+
</td>
|
1148
|
+
<td>
|
1149
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 165</span>
|
1150
|
+
|
1151
|
+
<span class='kw'>def</span> <span class='op'>[]</span><span class='lparen'>(</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rparen'>)</span>
|
1152
|
+
<span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_component_id'>component_id</span><span class='rbracket'>]</span>
|
1153
|
+
<span class='kw'>end</span></pre>
|
1154
|
+
</td>
|
1155
|
+
</tr>
|
1156
|
+
</table>
|
1157
|
+
</div>
|
1158
|
+
|
1159
|
+
<div class="method_details ">
|
1160
|
+
<h3 class="signature " id="each-class_method">
|
1161
|
+
|
1162
|
+
.<strong>each</strong>(&block) ⇒ <tt>Enumerator</tt>
|
1163
|
+
|
1164
|
+
|
1165
|
+
|
1166
|
+
|
1167
|
+
|
1168
|
+
</h3><div class="docstring">
|
1169
|
+
<div class="discussion">
|
1170
|
+
|
1171
|
+
<p>Iterates over all components within the component manager. Special Enumerable methods like <code>map</code> or <code>each_with_index</code> are not implemented</p>
|
1172
|
+
|
1173
|
+
|
1174
|
+
</div>
|
1175
|
+
</div>
|
1176
|
+
<div class="tags">
|
1177
|
+
|
1178
|
+
<p class="tag_title">Returns:</p>
|
1179
|
+
<ul class="return">
|
1180
|
+
|
1181
|
+
<li>
|
1182
|
+
|
1183
|
+
|
1184
|
+
<span class='type'>(<tt>Enumerator</tt>)</span>
|
1185
|
+
|
1186
|
+
|
1187
|
+
|
1188
|
+
</li>
|
1189
|
+
|
1190
|
+
</ul>
|
1191
|
+
|
1192
|
+
</div><table class="source_code">
|
1193
|
+
<tr>
|
1194
|
+
<td>
|
1195
|
+
<pre class="lines">
|
1196
|
+
|
1197
|
+
|
1198
|
+
172
|
1199
|
+
173
|
1200
|
+
174</pre>
|
1201
|
+
</td>
|
1202
|
+
<td>
|
1203
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 172</span>
|
1204
|
+
|
1205
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1206
|
+
<span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
|
1207
|
+
<span class='kw'>end</span></pre>
|
1208
|
+
</td>
|
1209
|
+
</tr>
|
1210
|
+
</table>
|
1211
|
+
</div>
|
1212
|
+
|
1213
|
+
</div>
|
1214
|
+
|
1215
|
+
<div id="instance_method_details" class="method_details_list">
|
1216
|
+
<h2>Instance Method Details</h2>
|
1217
|
+
|
1218
|
+
|
1219
|
+
<div class="method_details first">
|
1220
|
+
<h3 class="signature first" id="attr_changed_trigger_systems-instance_method">
|
1221
|
+
|
1222
|
+
#<strong>attr_changed_trigger_systems</strong>(attr) ⇒ <tt>Boolean</tt>
|
1223
|
+
|
1224
|
+
|
1225
|
+
|
1226
|
+
|
1227
|
+
|
1228
|
+
</h3><div class="docstring">
|
1229
|
+
<div class="discussion">
|
1230
|
+
|
1231
|
+
<p>Execute systems that have been added to execute on variable change</p>
|
1232
|
+
|
1233
|
+
|
1234
|
+
</div>
|
1235
|
+
</div>
|
1236
|
+
<div class="tags">
|
1237
|
+
|
1238
|
+
<p class="tag_title">Returns:</p>
|
1239
|
+
<ul class="return">
|
1240
|
+
|
1241
|
+
<li>
|
1242
|
+
|
1243
|
+
|
1244
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1245
|
+
|
1246
|
+
|
1247
|
+
|
1248
|
+
—
|
1249
|
+
<div class='inline'>
|
1250
|
+
<p><code>true</code></p>
|
1251
|
+
</div>
|
1252
|
+
|
1253
|
+
</li>
|
1254
|
+
|
1255
|
+
</ul>
|
1256
|
+
|
1257
|
+
</div><table class="source_code">
|
1258
|
+
<tr>
|
1259
|
+
<td>
|
1260
|
+
<pre class="lines">
|
1261
|
+
|
1262
|
+
|
1263
|
+
199
|
1264
|
+
200
|
1265
|
+
201
|
1266
|
+
202
|
1267
|
+
203
|
1268
|
+
204
|
1269
|
+
205
|
1270
|
+
206
|
1271
|
+
207</pre>
|
1272
|
+
</td>
|
1273
|
+
<td>
|
1274
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 199</span>
|
1275
|
+
|
1276
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_attr_changed_trigger_systems'>attr_changed_trigger_systems</span><span class='lparen'>(</span><span class='id identifier rubyid_attr'>attr</span><span class='rparen'>)</span>
|
1277
|
+
<span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span> <span class='op'>=</span> <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span>
|
1278
|
+
<span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1279
|
+
|
1280
|
+
<span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span> <span class='op'>|=</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span> <span class='kw'>unless</span> <span class='id identifier rubyid_attr_triggers'>attr_triggers</span><span class='lbracket'>[</span><span class='id identifier rubyid_attr'>attr</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
|
1281
|
+
|
1282
|
+
<span class='id identifier rubyid_systems_to_execute'>systems_to_execute</span><span class='period'>.</span><span class='id identifier rubyid_sort_by'>sort_by</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:priority</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_reverse'>reverse</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:call</span><span class='rparen'>)</span>
|
1283
|
+
<span class='kw'>true</span>
|
1284
|
+
<span class='kw'>end</span></pre>
|
1285
|
+
</td>
|
1286
|
+
</tr>
|
1287
|
+
</table>
|
1288
|
+
</div>
|
1289
|
+
|
1290
|
+
<div class="method_details ">
|
1291
|
+
<h3 class="signature " id="attrs-instance_method">
|
1292
|
+
|
1293
|
+
#<strong>attrs</strong> ⇒ <tt>Hash<Symbol, Value></tt>
|
1294
|
+
|
1295
|
+
|
1296
|
+
|
1297
|
+
|
1298
|
+
|
1299
|
+
</h3><div class="docstring">
|
1300
|
+
<div class="discussion">
|
1301
|
+
|
1302
|
+
<p>Returns A hash, where all the keys are attributes linked to their respective values.</p>
|
1303
|
+
|
1304
|
+
|
1305
|
+
</div>
|
1306
|
+
</div>
|
1307
|
+
<div class="tags">
|
1308
|
+
|
1309
|
+
<p class="tag_title">Returns:</p>
|
1310
|
+
<ul class="return">
|
1311
|
+
|
1312
|
+
<li>
|
1313
|
+
|
1314
|
+
|
1315
|
+
<span class='type'>(<tt>Hash<Symbol, Value></tt>)</span>
|
1316
|
+
|
1317
|
+
|
1318
|
+
|
1319
|
+
—
|
1320
|
+
<div class='inline'>
|
1321
|
+
<p>A hash, where all the keys are attributes linked to their respective values.</p>
|
1322
|
+
</div>
|
1323
|
+
|
1324
|
+
</li>
|
1325
|
+
|
1326
|
+
</ul>
|
1327
|
+
|
1328
|
+
</div><table class="source_code">
|
1329
|
+
<tr>
|
1330
|
+
<td>
|
1331
|
+
<pre class="lines">
|
1332
|
+
|
1333
|
+
|
1334
|
+
230
|
1335
|
+
231
|
1336
|
+
232
|
1337
|
+
233
|
1338
|
+
234
|
1339
|
+
235
|
1340
|
+
236</pre>
|
1341
|
+
</td>
|
1342
|
+
<td>
|
1343
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 230</span>
|
1344
|
+
|
1345
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_attrs'>attrs</span>
|
1346
|
+
<span class='id identifier rubyid_return_hash'>return_hash</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each_with_object'>each_with_object</span><span class='lparen'>(</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_final'>final</span><span class='op'>|</span>
|
1347
|
+
<span class='id identifier rubyid_final'>final</span><span class='lbracket'>[</span><span class='id identifier rubyid_key'>key</span><span class='period'>.</span><span class='id identifier rubyid_to_s'>to_s</span><span class='period'>.</span><span class='id identifier rubyid_delete_prefix'>delete_prefix</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>@</span><span class='tstring_end'>'</span></span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_to_sym'>to_sym</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_instance_variable_get'>instance_variable_get</span><span class='lparen'>(</span><span class='id identifier rubyid_key'>key</span><span class='rparen'>)</span>
|
1348
|
+
<span class='kw'>end</span>
|
1349
|
+
<span class='id identifier rubyid_return_hash'>return_hash</span><span class='period'>.</span><span class='id identifier rubyid_delete'>delete</span><span class='lparen'>(</span><span class='symbol'>:attr_triggers</span><span class='rparen'>)</span>
|
1350
|
+
<span class='id identifier rubyid_return_hash'>return_hash</span>
|
1351
|
+
<span class='kw'>end</span></pre>
|
1352
|
+
</td>
|
1353
|
+
</tr>
|
1354
|
+
</table>
|
1355
|
+
</div>
|
1356
|
+
|
1357
|
+
<div class="method_details ">
|
1358
|
+
<h3 class="signature " id="delete-instance_method">
|
1359
|
+
|
1360
|
+
#<strong>delete</strong> ⇒ <tt>Boolean</tt>
|
1361
|
+
|
1362
|
+
|
1363
|
+
|
1364
|
+
|
1365
|
+
|
1366
|
+
</h3><div class="docstring">
|
1367
|
+
<div class="discussion">
|
1368
|
+
|
1369
|
+
<p>Removes this component from the list and purges all references to this Component from other Entities, as well as its <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID</a></span> and data.</p>
|
1370
|
+
|
1371
|
+
|
1372
|
+
</div>
|
1373
|
+
</div>
|
1374
|
+
<div class="tags">
|
1375
|
+
|
1376
|
+
<p class="tag_title">Returns:</p>
|
1377
|
+
<ul class="return">
|
1378
|
+
|
1379
|
+
<li>
|
1380
|
+
|
1381
|
+
|
1382
|
+
<span class='type'>(<tt>Boolean</tt>)</span>
|
1383
|
+
|
1384
|
+
|
1385
|
+
|
1386
|
+
—
|
1387
|
+
<div class='inline'>
|
1388
|
+
<p><code>true</code>.</p>
|
1389
|
+
</div>
|
1390
|
+
|
1391
|
+
</li>
|
1392
|
+
|
1393
|
+
</ul>
|
1394
|
+
|
1395
|
+
</div><table class="source_code">
|
1396
|
+
<tr>
|
1397
|
+
<td>
|
1398
|
+
<pre class="lines">
|
1399
|
+
|
1400
|
+
|
1401
|
+
211
|
1402
|
+
212
|
1403
|
+
213
|
1404
|
+
214
|
1405
|
+
215
|
1406
|
+
216
|
1407
|
+
217
|
1408
|
+
218
|
1409
|
+
219
|
1410
|
+
220
|
1411
|
+
221
|
1412
|
+
222
|
1413
|
+
223
|
1414
|
+
224
|
1415
|
+
225
|
1416
|
+
226
|
1417
|
+
227</pre>
|
1418
|
+
</td>
|
1419
|
+
<td>
|
1420
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 211</span>
|
1421
|
+
|
1422
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_delete'>delete</span>
|
1423
|
+
<span class='id identifier rubyid_addition_triggers'>addition_triggers</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_system'>system</span><span class='op'>|</span>
|
1424
|
+
<span class='id identifier rubyid_system'>system</span><span class='period'>.</span><span class='id identifier rubyid_clear_triggers'>clear_triggers</span> <span class='label'>component_or_manager:</span> <span class='kw'>self</span>
|
1425
|
+
<span class='kw'>end</span>
|
1426
|
+
<span class='comment'># This needs to be cloned because indices get deleted as
|
1427
|
+
</span> <span class='comment'># the remove command is called, breaking the loop if it
|
1428
|
+
</span> <span class='comment'># wasn't referencing a clone(will get Nil errors)
|
1429
|
+
</span> <span class='id identifier rubyid_iter'>iter</span> <span class='op'>=</span> <span class='id identifier rubyid_entities'>entities</span><span class='period'>.</span><span class='id identifier rubyid_map'>map</span><span class='lparen'>(</span><span class='op'>&</span><span class='symbol'>:clone</span><span class='rparen'>)</span>
|
1430
|
+
<span class='id identifier rubyid_iter'>iter</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='op'>|</span>
|
1431
|
+
<span class='const'><span class='object_link'><a href="../FelFlame.html" title="FelFlame (class)">FelFlame</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Entities.html" title="FelFlame::Entities (class)">Entities</a></span></span><span class='lbracket'>[</span><span class='id identifier rubyid_entity_id'>entity_id</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_remove'>remove</span> <span class='kw'>self</span> <span class='comment'>#unless FelFlame::Entities[entity_id].nil?
|
1432
|
+
</span> <span class='kw'>end</span>
|
1433
|
+
<span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_class'>class</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='lbracket'>[</span><span class='id identifier rubyid_id'>id</span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='kw'>nil</span>
|
1434
|
+
<span class='id identifier rubyid_instance_variables'>instance_variables</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_var'>var</span><span class='op'>|</span>
|
1435
|
+
<span class='id identifier rubyid_instance_variable_set'>instance_variable_set</span><span class='lparen'>(</span><span class='id identifier rubyid_var'>var</span><span class='comma'>,</span> <span class='kw'>nil</span><span class='rparen'>)</span>
|
1436
|
+
<span class='kw'>end</span>
|
1437
|
+
<span class='kw'>true</span>
|
1438
|
+
<span class='kw'>end</span></pre>
|
1439
|
+
</td>
|
1440
|
+
</tr>
|
1441
|
+
</table>
|
1442
|
+
</div>
|
1443
|
+
|
1444
|
+
<div class="method_details ">
|
1445
|
+
<h3 class="signature " id="entities-instance_method">
|
1446
|
+
|
1447
|
+
#<strong>entities</strong> ⇒ <tt>Array<Integer></tt>
|
1448
|
+
|
1449
|
+
|
1450
|
+
|
1451
|
+
|
1452
|
+
|
1453
|
+
</h3><div class="docstring">
|
1454
|
+
<div class="discussion">
|
1455
|
+
|
1456
|
+
<p>A list of entity ids that are linked to the component</p>
|
1457
|
+
|
1458
|
+
|
1459
|
+
</div>
|
1460
|
+
</div>
|
1461
|
+
<div class="tags">
|
1462
|
+
|
1463
|
+
<p class="tag_title">Returns:</p>
|
1464
|
+
<ul class="return">
|
1465
|
+
|
1466
|
+
<li>
|
1467
|
+
|
1468
|
+
|
1469
|
+
<span class='type'>(<tt>Array<Integer></tt>)</span>
|
1470
|
+
|
1471
|
+
|
1472
|
+
|
1473
|
+
</li>
|
1474
|
+
|
1475
|
+
</ul>
|
1476
|
+
|
1477
|
+
</div><table class="source_code">
|
1478
|
+
<tr>
|
1479
|
+
<td>
|
1480
|
+
<pre class="lines">
|
1481
|
+
|
1482
|
+
|
1483
|
+
185
|
1484
|
+
186
|
1485
|
+
187</pre>
|
1486
|
+
</td>
|
1487
|
+
<td>
|
1488
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 185</span>
|
1489
|
+
|
1490
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_entities'>entities</span>
|
1491
|
+
<span class='ivar'>@entities</span> <span class='op'>||=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
|
1492
|
+
<span class='kw'>end</span></pre>
|
1493
|
+
</td>
|
1494
|
+
</tr>
|
1495
|
+
</table>
|
1496
|
+
</div>
|
1497
|
+
|
1498
|
+
<div class="method_details ">
|
1499
|
+
<h3 class="signature " id="to_i-instance_method">
|
1500
|
+
|
1501
|
+
#<strong>to_i</strong> ⇒ <tt>Integer</tt>
|
1502
|
+
|
1503
|
+
|
1504
|
+
|
1505
|
+
|
1506
|
+
|
1507
|
+
</h3><div class="docstring">
|
1508
|
+
<div class="discussion">
|
1509
|
+
|
1510
|
+
<p>An alias for the <span class='object_link'><a href="#id-instance_method" title="FelFlame::ComponentManager#id (method)">ID Reader</a></span></p>
|
1511
|
+
|
1512
|
+
|
1513
|
+
</div>
|
1514
|
+
</div>
|
1515
|
+
<div class="tags">
|
1516
|
+
|
1517
|
+
<p class="tag_title">Returns:</p>
|
1518
|
+
<ul class="return">
|
1519
|
+
|
1520
|
+
<li>
|
1521
|
+
|
1522
|
+
|
1523
|
+
<span class='type'>(<tt>Integer</tt>)</span>
|
1524
|
+
|
1525
|
+
|
1526
|
+
|
1527
|
+
</li>
|
1528
|
+
|
1529
|
+
</ul>
|
1530
|
+
|
1531
|
+
</div><table class="source_code">
|
1532
|
+
<tr>
|
1533
|
+
<td>
|
1534
|
+
<pre class="lines">
|
1535
|
+
|
1536
|
+
|
1537
|
+
179
|
1538
|
+
180
|
1539
|
+
181</pre>
|
1540
|
+
</td>
|
1541
|
+
<td>
|
1542
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 179</span>
|
1543
|
+
|
1544
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_i'>to_i</span>
|
1545
|
+
<span class='id identifier rubyid_id'>id</span>
|
1546
|
+
<span class='kw'>end</span></pre>
|
1547
|
+
</td>
|
1548
|
+
</tr>
|
1549
|
+
</table>
|
1550
|
+
</div>
|
1551
|
+
|
1552
|
+
<div class="method_details ">
|
1553
|
+
<h3 class="signature " id="update_attrs-instance_method">
|
1554
|
+
|
1555
|
+
#<strong>update_attrs</strong>(**opts) ⇒ <tt>Hash<Symbol, Value></tt>
|
1556
|
+
|
1557
|
+
|
1558
|
+
|
1559
|
+
|
1560
|
+
|
1561
|
+
</h3><div class="docstring">
|
1562
|
+
<div class="discussion">
|
1563
|
+
|
1564
|
+
<p>Update attribute values using a hash or keywords.</p>
|
1565
|
+
|
1566
|
+
|
1567
|
+
</div>
|
1568
|
+
</div>
|
1569
|
+
<div class="tags">
|
1570
|
+
|
1571
|
+
<p class="tag_title">Returns:</p>
|
1572
|
+
<ul class="return">
|
1573
|
+
|
1574
|
+
<li>
|
1575
|
+
|
1576
|
+
|
1577
|
+
<span class='type'>(<tt>Hash<Symbol, Value></tt>)</span>
|
1578
|
+
|
1579
|
+
|
1580
|
+
|
1581
|
+
—
|
1582
|
+
<div class='inline'>
|
1583
|
+
<p>Hash of updated attributes</p>
|
1584
|
+
</div>
|
1585
|
+
|
1586
|
+
</li>
|
1587
|
+
|
1588
|
+
</ul>
|
1589
|
+
|
1590
|
+
</div><table class="source_code">
|
1591
|
+
<tr>
|
1592
|
+
<td>
|
1593
|
+
<pre class="lines">
|
1594
|
+
|
1595
|
+
|
1596
|
+
191
|
1597
|
+
192
|
1598
|
+
193
|
1599
|
+
194
|
1600
|
+
195</pre>
|
1601
|
+
</td>
|
1602
|
+
<td>
|
1603
|
+
<pre class="code"><span class="info file"># File 'component_manager.rb', line 191</span>
|
1604
|
+
|
1605
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_update_attrs'>update_attrs</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_opts'>opts</span><span class='rparen'>)</span>
|
1606
|
+
<span class='id identifier rubyid_opts'>opts</span><span class='period'>.</span><span class='id identifier rubyid_each'>each</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
|
1607
|
+
<span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_key'>key</span><span class='embexpr_end'>}</span><span class='tstring_content'>=</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='id identifier rubyid_value'>value</span>
|
1608
|
+
<span class='kw'>end</span>
|
1609
|
+
<span class='kw'>end</span></pre>
|
1610
|
+
</td>
|
1611
|
+
</tr>
|
1612
|
+
</table>
|
1613
|
+
</div>
|
1614
|
+
|
1615
|
+
</div>
|
1616
|
+
|
1617
|
+
</div>
|
1618
|
+
|
1619
|
+
<div id="footer">
|
1620
|
+
Generated on Fri Jul 9 01:56:54 2021 by
|
1621
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1622
|
+
0.9.26 (ruby-2.7.3).
|
1623
|
+
</div>
|
1624
|
+
|
1625
|
+
</div>
|
1626
|
+
</body>
|
1627
|
+
</html>
|