baku 0.2.5 → 0.2.6
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/entity.rb +2 -1
- data/lib/baku/entity_manager.rb +3 -3
- data/lib/baku/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d2763ede4661622889dd5408420549df6cd9abc
|
4
|
+
data.tar.gz: 03d33e683578f3df73f38d41a458492864281dcb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 712e0526dfdff24c604c5ebdda331c30b4b27c3be0e4b3b6cfc2340c7293ef9f6221f9e93763ae38811dcfae8ce97a75b5aa5111de22bba760d4d206c08dc76d
|
7
|
+
data.tar.gz: 650c477a001bc33e34ea1ad2544529bea93ecfb0a51d9faa2e7ac59a0f23f0b932c98c699f9521b573e1aa42b33624e97d29e0fcc5accc845740c3a156244a55
|
data/CHANGELOG.md
CHANGED
data/lib/baku/entity.rb
CHANGED
@@ -28,11 +28,12 @@ module Baku
|
|
28
28
|
new("Entity does not have component: #{component_class}")
|
29
29
|
end
|
30
30
|
|
31
|
+
removed_component = @components[component_class]
|
31
32
|
@components.delete(component_class)
|
32
33
|
|
33
34
|
update_component_mask
|
34
35
|
|
35
|
-
dispatch_event(:component_removed, self,
|
36
|
+
dispatch_event(:component_removed, self, removed_component)
|
36
37
|
end
|
37
38
|
|
38
39
|
def has_component?(component_class)
|
data/lib/baku/entity_manager.rb
CHANGED
@@ -74,12 +74,12 @@ module Baku
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def on_entity_component_removed(entity, component)
|
77
|
-
old_mask = ComponentMask.from_components(entity.components + component)
|
77
|
+
old_mask = ComponentMask.from_components(entity.components.keys + [component.class])
|
78
78
|
new_mask = entity.component_mask
|
79
79
|
|
80
80
|
@entities_by_component_mask.each do |component_mask, entities|
|
81
|
-
old_match = component_mask.
|
82
|
-
new_match = component_mask.
|
81
|
+
old_match = component_mask.matches?(old_mask)
|
82
|
+
new_match = component_mask.matches?(new_mask)
|
83
83
|
|
84
84
|
if old_match && !new_match
|
85
85
|
entities.delete(entity)
|
data/lib/baku/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: baku
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Tuttle
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|