darkholme 0.9.0 → 0.9.1

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: a622c249ab3e57ac8e924f96a3e8016eb703c1df
4
- data.tar.gz: 4299d324cf08736524dfdaabc1248de738afe29b
3
+ metadata.gz: c96502aea889b8b96233989a44c91611918115f4
4
+ data.tar.gz: 4bd198e683c64ad3b28a05536aa07034bbdb91eb
5
5
  SHA512:
6
- metadata.gz: b8eaed977e5057199acb6a6f2ce459a49d043b389aced53d02434943ee0d2325db46b08a4ac0175d0fd53ab30661cfbc5d679e15ffd3a2effcf9740110c00849
7
- data.tar.gz: 3bb5b0208608cbb869b409a458d99ad7584191bca187dd6bb05519028876b914dc5ebec2be7cc511dfc85a1367ef364b09eaa0ed749710411372fed251117c27
6
+ metadata.gz: 490d144381019b4ca83651917fdc71d74410fe2238c252079eb42e3b673b6f8e2a7eeea3eb58b371c540ac522b03f6b648beb5b411c4b25f8416f13daca6b9f6
7
+ data.tar.gz: e232f4dbde1ac5588e6e0e6ab9e8a3a8ec5d2fd9d34ac9db3eb5bf519a17c2c282df2ebee6ade2dec8dbd9fc5b85fd200fbd763bd00535e628235d67d181dc59
data/Rakefile CHANGED
@@ -22,8 +22,8 @@ Jeweler::Tasks.new do |gem|
22
22
  gem.name = "darkholme"
23
23
  gem.homepage = "http://github.com/evanwalsh/darkholme"
24
24
  gem.license = "MIT"
25
- gem.summary = %Q{An entity-component system in Ruby for libgdx}
26
- gem.description = %Q{An entity-component system in Ruby for libgdx}
25
+ gem.summary = %Q{An entity-component system in Ruby for}
26
+ gem.description = %Q{An entity-component system in Ruby}
27
27
  gem.email = "evan@massivedanger.com"
28
28
  gem.authors = ["Massive Danger"]
29
29
  # dependencies defined in Gemfile
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.0
1
+ 0.9.1
data/darkholme.gemspec CHANGED
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: darkholme 0.9.0 ruby lib
5
+ # stub: darkholme 0.9.1 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "darkholme"
9
- s.version = "0.9.0"
9
+ s.version = "0.9.1"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.authors = ["Massive Danger"]
13
- s.date = "2014-02-22"
14
- s.description = "An entity-component system in Ruby for libgdx"
13
+ s.date = "2014-02-23"
14
+ s.description = "An entity-component system in Ruby"
15
15
  s.email = "evan@massivedanger.com"
16
16
  s.extra_rdoc_files = [
17
17
  "LICENSE.txt",
@@ -35,12 +35,14 @@ Gem::Specification.new do |s|
35
35
  "lib/darkholme/engine.rb",
36
36
  "lib/darkholme/entity.rb",
37
37
  "lib/darkholme/family.rb",
38
+ "lib/darkholme/iterating_system.rb",
38
39
  "lib/darkholme/system.rb",
39
40
  "spec/lib/darkholme/bitset_spec.rb",
40
41
  "spec/lib/darkholme/component_spec.rb",
41
42
  "spec/lib/darkholme/engine_spec.rb",
42
43
  "spec/lib/darkholme/entity_spec.rb",
43
44
  "spec/lib/darkholme/family_spec.rb",
45
+ "spec/lib/darkholme/iterating_system_spec.rb",
44
46
  "spec/lib/darkholme/system_spec.rb",
45
47
  "spec/lib/darkholme_spec.rb",
46
48
  "spec/spec_helper.rb",
@@ -50,7 +52,7 @@ Gem::Specification.new do |s|
50
52
  s.licenses = ["MIT"]
51
53
  s.require_paths = ["lib"]
52
54
  s.rubygems_version = "2.1.11"
53
- s.summary = "An entity-component system in Ruby for libgdx"
55
+ s.summary = "An entity-component system in Ruby for"
54
56
 
55
57
  if s.respond_to? :specification_version then
56
58
  s.specification_version = 4
data/lib/darkholme.rb CHANGED
@@ -2,6 +2,7 @@ require 'darkholme/bitset'
2
2
  require 'darkholme/engine'
3
3
  require 'darkholme/entity'
4
4
  require 'darkholme/system'
5
+ require 'darkholme/iterating_system'
5
6
  require 'darkholme/component'
6
7
  require 'darkholme/family'
7
8
 
@@ -0,0 +1,21 @@
1
+ module Darkholme
2
+ class IteratingSystem < System
3
+ def update(delta)
4
+ before_processing
5
+ entities.each do |entity|
6
+ process(entity, delta)
7
+ end
8
+ after_processing
9
+ end
10
+
11
+ def process(entity, delta)
12
+ raise NotImplementedError.new("You must override #process(entity, delta)")
13
+ end
14
+
15
+ def before_processing
16
+ end
17
+
18
+ def after_processing
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,28 @@
1
+ require 'spec_helper'
2
+
3
+ module Darkholme
4
+ describe IteratingSystem do
5
+ subject { MockIteratingSystem.new }
6
+
7
+ it "loops through entities on update" do
8
+ expect(subject).to receive(:entities).and_return([:one, :two, :three])
9
+ expect(subject).to receive(:process).exactly(3).times.and_return(true)
10
+
11
+ subject.update(:delta)
12
+ end
13
+
14
+ it "calls before_processing before processing" do
15
+ expect(subject).to receive(:before_processing)
16
+ expect(subject).to receive(:entities).and_return([])
17
+
18
+ subject.update(:delta)
19
+ end
20
+
21
+ it "calls after_processing after processing" do
22
+ expect(subject).to receive(:after_processing)
23
+ expect(subject).to receive(:entities).and_return([])
24
+
25
+ subject.update(:delta)
26
+ end
27
+ end
28
+ end
@@ -7,3 +7,7 @@ end
7
7
  class MockSystem < Darkholme::System
8
8
  has_family MockComponent
9
9
  end
10
+
11
+ class MockIteratingSystem < Darkholme::IteratingSystem
12
+ has_family MockComponent
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: darkholme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Massive Danger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-22 00:00:00.000000000 Z
11
+ date: 2014-02-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pry
@@ -136,7 +136,7 @@ dependencies:
136
136
  - - ~>
137
137
  - !ruby/object:Gem::Version
138
138
  version: 0.2.3
139
- description: An entity-component system in Ruby for libgdx
139
+ description: An entity-component system in Ruby
140
140
  email: evan@massivedanger.com
141
141
  executables: []
142
142
  extensions: []
@@ -161,12 +161,14 @@ files:
161
161
  - lib/darkholme/engine.rb
162
162
  - lib/darkholme/entity.rb
163
163
  - lib/darkholme/family.rb
164
+ - lib/darkholme/iterating_system.rb
164
165
  - lib/darkholme/system.rb
165
166
  - spec/lib/darkholme/bitset_spec.rb
166
167
  - spec/lib/darkholme/component_spec.rb
167
168
  - spec/lib/darkholme/engine_spec.rb
168
169
  - spec/lib/darkholme/entity_spec.rb
169
170
  - spec/lib/darkholme/family_spec.rb
171
+ - spec/lib/darkholme/iterating_system_spec.rb
170
172
  - spec/lib/darkholme/system_spec.rb
171
173
  - spec/lib/darkholme_spec.rb
172
174
  - spec/spec_helper.rb
@@ -194,5 +196,5 @@ rubyforge_project:
194
196
  rubygems_version: 2.1.11
195
197
  signing_key:
196
198
  specification_version: 4
197
- summary: An entity-component system in Ruby for libgdx
199
+ summary: An entity-component system in Ruby for
198
200
  test_files: []