Class: Kawaii::NodeManager
- Inherits:
-
Object
- Object
- Kawaii::NodeManager
- Defined in:
- lib/kawaii/node_manager.rb
Instance Attribute Summary collapse
-
#nodes ⇒ Object
Returns the value of attribute nodes.
Instance Method Summary collapse
- #clear ⇒ Object
- #count ⇒ Object
- #draw ⇒ Object
-
#initialize ⇒ NodeManager
constructor
A new instance of NodeManager.
- #update(dt) ⇒ Object
Constructor Details
#initialize ⇒ NodeManager
Returns a new instance of NodeManager.
7 8 9 |
# File 'lib/kawaii/node_manager.rb', line 7 def initialize @nodes = [] end |
Instance Attribute Details
#nodes ⇒ Object
Returns the value of attribute nodes.
5 6 7 |
# File 'lib/kawaii/node_manager.rb', line 5 def nodes @nodes end |
Instance Method Details
#clear ⇒ Object
31 32 33 |
# File 'lib/kawaii/node_manager.rb', line 31 def clear nodes.clear end |
#count ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/kawaii/node_manager.rb', line 11 def count sum = 0 nodes.each do |node| sum += node.count end sum end |
#draw ⇒ Object
25 26 27 28 29 |
# File 'lib/kawaii/node_manager.rb', line 25 def draw nodes.each do |node| node.draw end end |
#update(dt) ⇒ Object
19 20 21 22 23 |
# File 'lib/kawaii/node_manager.rb', line 19 def update dt nodes.each do |node| node.update dt end end |