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 +4 -4
- data/CHANGELOG.md +2 -2
- data/baku.gemspec +4 -4
- data/lib/baku/entity_manager.rb +6 -6
- data/lib/baku/version.rb +1 -1
- data/lib/baku/world.rb +8 -4
- metadata +13 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b52d816fde6a7c5914d47c68ee0d4340f40c287604400dfa20e946c5563f76d
|
4
|
+
data.tar.gz: 244794130031495e7f7f29ecb916e79bfd5b56755f118969fb03fd0527ef1b34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: af7e269453137bf61e0596795e5b991a59573e2820fa4c8b6fae5e43850ea80cb8b568b7747910ef7c34518efeb3c6180b48d14683f7cc4ff1ef76aeb1014c1f
|
7
|
+
data.tar.gz: 98b8e9ac8acf40447d646c070ec09ece6808b8f99a998825d74bd8400856da75607655e90016510635bb3c4a90159564dae3d1e0e0efa40d41d0e7e9507dee31
|
data/CHANGELOG.md
CHANGED
data/baku.gemspec
CHANGED
@@ -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.
|
23
|
-
spec.add_development_dependency 'rake', '~>
|
24
|
-
spec.add_development_dependency 'rspec', '~> 3.
|
25
|
-
spec.add_development_dependency 'pry-byebug', '~> 3.
|
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
|
data/lib/baku/entity_manager.rb
CHANGED
@@ -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
|
data/lib/baku/version.rb
CHANGED
data/lib/baku/world.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Baku
|
2
2
|
class World
|
3
|
-
|
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
|
-
|
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.
|
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:
|
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.
|
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.
|
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: '
|
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: '
|
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.
|
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.
|
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.
|
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.
|
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: []
|