Class: Kawaii::NodeManager

Inherits:
Object
  • Object
show all
Defined in:
lib/kawaii/node_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeNodeManager

Returns a new instance of NodeManager.



7
8
9
# File 'lib/kawaii/node_manager.rb', line 7

def initialize
  @nodes = []
end

Instance Attribute Details

#nodesObject

Returns the value of attribute nodes.



5
6
7
# File 'lib/kawaii/node_manager.rb', line 5

def nodes
  @nodes
end

Instance Method Details

#clearObject



31
32
33
# File 'lib/kawaii/node_manager.rb', line 31

def clear
  nodes.clear
end

#countObject



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

#drawObject



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