baku 0.3.1 → 1.0.0

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
  SHA256:
3
- metadata.gz: f95ddbe20ed9e1c88da6a47399d9a6f4ebf0cb5e0ad591b8cceae36a2091c103
4
- data.tar.gz: add1c691aa86d0b462c39353aa52ac6bd009b833f3314b4a5bb5f05148641a25
3
+ metadata.gz: 2b52d816fde6a7c5914d47c68ee0d4340f40c287604400dfa20e946c5563f76d
4
+ data.tar.gz: 244794130031495e7f7f29ecb916e79bfd5b56755f118969fb03fd0527ef1b34
5
5
  SHA512:
6
- metadata.gz: 59fd7f1018890d362342dfe25fdb5776301a1e6a6439eeac35a5136556fe95bdaac48e24a940a3c23a0505cf79a056c6be5c5031bc5cd4df7c104e55b4cd0fe5
7
- data.tar.gz: ebcd87f863c3ab2b092c8a01b965134cd5676714b4f1a4238c9a1d44520a31b86b4d1751db8c0e268e3f51a3c31a4fa71bcbf090636a13cce6c5718f7c80b64f
6
+ metadata.gz: af7e269453137bf61e0596795e5b991a59573e2820fa4c8b6fae5e43850ea80cb8b568b7747910ef7c34518efeb3c6180b48d14683f7cc4ff1ef76aeb1014c1f
7
+ data.tar.gz: 98b8e9ac8acf40447d646c070ec09ece6808b8f99a998825d74bd8400856da75607655e90016510635bb3c4a90159564dae3d1e0e0efa40d41d0e7e9507dee31
@@ -1,6 +1,6 @@
1
- # 0.3.1
1
+ # 1.0.0
2
2
 
3
- * Prevent system registration from overwriting existing entity list.
3
+ * Make blackboard static.
4
4
 
5
5
  # 0.3.0
6
6
 
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
19
19
  end
20
20
  spec.require_paths = ['lib']
21
21
 
22
- spec.add_development_dependency 'bundler', '~> 2.1.4'
23
- spec.add_development_dependency 'rake', '~> 13.0'
24
- spec.add_development_dependency 'rspec', '~> 3.9'
25
- spec.add_development_dependency 'pry-byebug', '~> 3.9.0'
22
+ spec.add_development_dependency 'bundler', '~> 2.0.2'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_development_dependency 'rspec', '~> 3.0'
25
+ spec.add_development_dependency 'pry-byebug', '~> 3.5.0'
26
26
 
27
27
  spec.add_dependency 'miru', '~> 0.1.0'
28
28
  end
@@ -15,12 +15,12 @@ module Baku
15
15
  end
16
16
 
17
17
  def register_component_mask(component_mask)
18
- @entities_by_component_mask[component_mask] ||= []
18
+ @entities_by_component_mask[component_mask] = []
19
19
  end
20
20
 
21
21
  def add_entity(entity)
22
22
  add_entity_to_matching_component_lists(entity)
23
-
23
+
24
24
  entity.add_event_listener(
25
25
  :component_added,
26
26
  method(:on_entity_component_added)
@@ -40,7 +40,7 @@ module Baku
40
40
  entity.tags.each do |tag|
41
41
  @entities_by_tag[tag].delete(entity)
42
42
  end
43
-
43
+
44
44
  entity.remove_event_listener(
45
45
  :component_added,
46
46
  method(:on_entity_component_added)
@@ -64,7 +64,7 @@ module Baku
64
64
  def get_entities_by_tag(tag)
65
65
  @entities_by_tag[tag] || []
66
66
  end
67
-
67
+
68
68
  private
69
69
 
70
70
  def add_entity_to_matching_component_lists(entity)
@@ -88,11 +88,11 @@ module Baku
88
88
  @entities_by_component_mask.each do |component_mask, entities|
89
89
  old_match = component_mask.matches?(old_mask)
90
90
  new_match = component_mask.matches?(new_mask)
91
-
91
+
92
92
  if old_match && !new_match
93
93
  entities.delete(entity)
94
94
  end
95
- end
95
+ end
96
96
  end
97
97
  end
98
98
  end
@@ -1,3 +1,3 @@
1
1
  module Baku
2
- VERSION = "0.3.1"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -1,6 +1,8 @@
1
1
  module Baku
2
2
  class World
3
- attr_reader :entity_manager, :blackboard, :delta_ms
3
+ @@blackboard = {}
4
+
5
+ attr_reader :entity_manager, :delta_ms
4
6
 
5
7
  def initialize
6
8
  # TODO: there's currently no way to interleave update and draw systems.
@@ -9,15 +11,17 @@ module Baku
9
11
  @draw_systems = []
10
12
 
11
13
  @entity_manager = EntityManager.new
12
-
13
- @blackboard = {}
14
14
  end
15
15
 
16
+ def self.blackboard
17
+ @@blackboard
18
+ end
19
+
16
20
  def dispose
17
21
  @update_systems.clear
18
22
  @draw_systems.clear
19
23
  @entity_manager.dispose
20
- @blackboard.clear
24
+ @@blackboard.clear
21
25
  end
22
26
 
23
27
  def add_system(system)
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.3.1
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Tuttle
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-12 00:00:00.000000000 Z
11
+ date: 2019-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.1.4
19
+ version: 2.0.2
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.1.4
26
+ version: 2.0.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '13.0'
33
+ version: '10.0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '13.0'
40
+ version: '10.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.9'
47
+ version: '3.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.9'
54
+ version: '3.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: pry-byebug
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 3.9.0
61
+ version: 3.5.0
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 3.9.0
68
+ version: 3.5.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: miru
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -112,7 +112,7 @@ homepage: https://github.com/jtuttle/baku
112
112
  licenses:
113
113
  - MIT
114
114
  metadata: {}
115
- post_install_message:
115
+ post_install_message:
116
116
  rdoc_options: []
117
117
  require_paths:
118
118
  - lib
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: '0'
129
129
  requirements: []
130
130
  rubygems_version: 3.0.6
131
- signing_key:
131
+ signing_key:
132
132
  specification_version: 4
133
133
  summary: An Entity Component System framework for Ruby
134
134
  test_files: []