baku 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/baku/system.rb +14 -2
- data/lib/baku/version.rb +1 -1
- data/lib/baku/world.rb +2 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4e011013e5257d5b0af62562561e971cf0e449b
|
4
|
+
data.tar.gz: 31931a5ea325fa8c8cb9e661e339935b83ac14fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b875ecf5c85daf770f8c91387848a93776aac8c5037112c9c9f5cd0832cb9948ebf7bfc321c035e4ce70848738d7622cecdc4607588ea3f45a92795c72f50f5f
|
7
|
+
data.tar.gz: 9bf020e852d6e1929541f7ccc7650360cea9d833e0bac78711ed33b196f84edf2a97b588beb98418bce1d94ba0cd4debc531fe6f6623a624114c3c2a3bf0c804
|
data/CHANGELOG.md
CHANGED
data/lib/baku/system.rb
CHANGED
@@ -8,12 +8,18 @@ module Baku
|
|
8
8
|
@game_loop_step = game_loop_step
|
9
9
|
end
|
10
10
|
|
11
|
-
def
|
11
|
+
def execute
|
12
12
|
if @world.nil?
|
13
13
|
raise StandardError.new("Must set :world property of System.")
|
14
14
|
end
|
15
15
|
|
16
|
-
@world.entity_manager.get_entities(component_mask)
|
16
|
+
entities = @world.entity_manager.get_entities(component_mask)
|
17
|
+
|
18
|
+
process_entities(entities)
|
19
|
+
end
|
20
|
+
|
21
|
+
def process_entities(entities)
|
22
|
+
entities.each do |entity|
|
17
23
|
entity_components = @components.map { |c| entity.get_component(c) }
|
18
24
|
process_entity(entity, *entity_components)
|
19
25
|
end
|
@@ -26,5 +32,11 @@ module Baku
|
|
26
32
|
def component_mask
|
27
33
|
@component_mask ||= ComponentMask.from_components(@components)
|
28
34
|
end
|
35
|
+
|
36
|
+
private
|
37
|
+
|
38
|
+
def retrieve_entities
|
39
|
+
@world.entity_manager.get_entities(component_mask)
|
40
|
+
end
|
29
41
|
end
|
30
42
|
end
|
data/lib/baku/version.rb
CHANGED
data/lib/baku/world.rb
CHANGED
@@ -44,16 +44,11 @@ module Baku
|
|
44
44
|
|
45
45
|
def update(delta_ms)
|
46
46
|
@delta_ms = delta_ms
|
47
|
-
|
48
|
-
@update_systems.each do |system|
|
49
|
-
system.process_entities
|
50
|
-
end
|
47
|
+
@update_systems.each(&:execute)
|
51
48
|
end
|
52
49
|
|
53
50
|
def draw
|
54
|
-
@draw_systems.each
|
55
|
-
system.process_entities
|
56
|
-
end
|
51
|
+
@draw_systems.each(&:execute)
|
57
52
|
end
|
58
53
|
end
|
59
54
|
end
|