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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4635f01f25cbff83a5aa0938436ed437a367c91f
4
- data.tar.gz: 98cbe6bac2f0ff44d30379d31835e9aa1b5517e1
3
+ metadata.gz: 1d2763ede4661622889dd5408420549df6cd9abc
4
+ data.tar.gz: 03d33e683578f3df73f38d41a458492864281dcb
5
5
  SHA512:
6
- metadata.gz: 2d44df506415840612bd94bbe97a97b97578f675f07140148cb23bf10843d99cb2d26272865b2ec457de12790c98936daae4482f6496a117e4de876719bf4ec9
7
- data.tar.gz: 71e863d553c62ea6685cbb7f66e4e1a96bd7084568cd6d422c623165ff81ea63a68d07492fa66b49afd4e80578bf957b2834ee81e7c7c449e8cbf39a9c716634
6
+ metadata.gz: 712e0526dfdff24c604c5ebdda331c30b4b27c3be0e4b3b6cfc2340c7293ef9f6221f9e93763ae38811dcfae8ce97a75b5aa5111de22bba760d4d206c08dc76d
7
+ data.tar.gz: 650c477a001bc33e34ea1ad2544529bea93ecfb0a51d9faa2e7ac59a0f23f0b932c98c699f9521b573e1aa42b33624e97d29e0fcc5accc845740c3a156244a55
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.2.6
2
+
3
+ * Fix bug with entity component removal.
4
+
1
5
  # 0.2.5
2
6
 
3
7
  * Add has_component? to Entity.
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, @components[component_class])
36
+ dispatch_event(:component_removed, self, removed_component)
36
37
  end
37
38
 
38
39
  def has_component?(component_class)
@@ -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.match?(old_mask)
82
- new_match = component_mask.match?(new_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
@@ -1,3 +1,3 @@
1
1
  module Baku
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.6"
3
3
  end
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.5
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: 2017-11-26 00:00:00.000000000 Z
11
+ date: 2018-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler