gamefic 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d39e0e4c0bdd08258174c87bfe75b1a44ab60643
4
- data.tar.gz: 201eb4941dc0d59a784992c35068a379287d9e0e
3
+ metadata.gz: 8d8b026aaef618411c88290ed37d4eec962d91cd
4
+ data.tar.gz: c441f836978528d55d6a8dc856a62c889c62af7b
5
5
  SHA512:
6
- metadata.gz: 4939cd6592c098ce8d407b654c38c1ba75583b95b0581c8c834c3d973e9e415d36095317f837888b937e0ceb2231cfc80e003b3c59e9ff0c75b8547af4c8eb98
7
- data.tar.gz: eece7938f58fdbf2746061eb85c2eb932fe0773afd966f544c3cb9c7ac87131da403b339cedd46bdc2ffb07fc4dda5a7626c675ed7b2dc569aa05698ea2a30f0
6
+ metadata.gz: f628a686e81c26eb6c24f0157d9630cee6d3b34d0fe964dee81fa61a8bb70abe9507c3f50689f7278c724e1fd8dbfd2a6bf54296c436e38e67b1b282a3d9899b
7
+ data.tar.gz: 3d680aea4280a9adf8a9c29e035156bed699a1cf979c141e5e950bd2d0739d75a3d4f1e41180b2924f187dc54875adc43274c7d87302c495f47c79d64e2d1fec
data/lib/gamefic/plot.rb CHANGED
@@ -21,54 +21,28 @@ module Gamefic
21
21
  post_initialize
22
22
  end
23
23
  def post_initialize
24
- Action.defaults.each {|a|
25
- add_action a
26
- }
27
- Syntax.defaults.each {|s|
28
- add_syntax s
29
- }
24
+ # TODO: Should this method be required by extended classes?
30
25
  end
31
- #def require_defaults
32
- #Dir[File.dirname(__FILE__) + '/entity_ext/*.rb'].each do |file|
33
- # require file
34
- #end
35
- #Dir[File.dirname(__FILE__) + '/action_ext/*.rb'].each do |file|
36
- # require_script file
37
- #end
38
- #end
39
26
  def action(command, *queries, &proc)
40
27
  act = Action.new(self, command, *queries, &proc)
41
28
  end
42
29
  def respond(command, *queries, &proc)
43
30
  self.action(command, *queries, &proc)
44
31
  end
45
- def entity(cls, args)
32
+ def make(cls, args = {})
46
33
  ent = cls.new(self, args)
47
34
  if ent.kind_of?(Entity) == false
48
35
  raise "Invalid entity class"
49
36
  end
50
- #@entities.push ent
51
37
  ent
52
38
  end
53
- def make(cls, args = {})
54
- self.entity(cls, args)
55
- end
56
39
  def syntax(*args)
40
+ end
41
+ def xlate(*args)
57
42
  syn = Syntax.new(self, *args)
58
43
  @syntaxes.push syn
59
44
  syn
60
45
  end
61
- def xlate(*args)
62
- syntax(*args)
63
- end
64
- #def add_entity(entity)
65
- # if @entities.include?(entity) == false
66
- # @entities.push entity
67
- # end
68
- #end
69
- def rem_entity(entity)
70
- @entities.delete(entity)
71
- end
72
46
  def entities
73
47
  @entities.clone
74
48
  end
@@ -128,7 +102,12 @@ module Gamefic
128
102
  load_script filename
129
103
  end
130
104
  end
105
+
131
106
  private
107
+
108
+ def rem_entity(entity)
109
+ @entities.delete(entity)
110
+ end
132
111
  def recursive_update(entity)
133
112
  entity.update
134
113
  entity.children.each { |e|
@@ -180,6 +159,12 @@ module Gamefic
180
159
  }
181
160
  Syntax.new self, *[user_friendly, action.command] + args
182
161
  end
162
+ def rem_action(action)
163
+ @commands[action.command].delete(action)
164
+ end
165
+ def rem_syntax(syntax)
166
+ @syntaxes.delete syntax
167
+ end
183
168
  def add_entity(entity)
184
169
  @entities.push entity
185
170
  end
@@ -0,0 +1,14 @@
1
+ module Gamefic
2
+
3
+ class Story < Plot
4
+ def post_initialize
5
+ Action.defaults.each {|a|
6
+ add_action a
7
+ }
8
+ Syntax.defaults.each {|s|
9
+ add_syntax s
10
+ }
11
+ end
12
+ end
13
+
14
+ end
data/lib/gamefic.rb CHANGED
@@ -8,5 +8,6 @@ require "gamefic/syntax"
8
8
  require "gamefic/query"
9
9
  require "gamefic/director"
10
10
  require "gamefic/plot"
11
+ require "gamefic/story"
11
12
  require "gamefic/engine"
12
13
  require "gamefic/user"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gamefic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Snyder
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-13 00:00:00.000000000 Z
11
+ date: 2013-12-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An adventure game engine
14
14
  email: fsnyder@gamefic.com
@@ -19,6 +19,7 @@ files:
19
19
  - lib/gamefic.rb
20
20
  - lib/gamefic/entity.rb
21
21
  - lib/gamefic/character.rb
22
+ - lib/gamefic/story.rb
22
23
  - lib/gamefic/base.rb
23
24
  - lib/gamefic/query.rb
24
25
  - lib/gamefic/action.rb
@@ -44,7 +45,6 @@ files:
44
45
  - lib/gamefic/entity_ext/itemized.rb
45
46
  - lib/gamefic/entity_ext/room.rb
46
47
  - lib/gamefic/entity_ext/portal.rb
47
- - lib/gamefic/entity_ext/zone.rb
48
48
  - lib/gamefic/entity_ext/container.rb
49
49
  homepage: http://gamefic.com
50
50
  licenses:
@@ -1,8 +0,0 @@
1
- module Gamefic
2
-
3
- # An optional class for grouping entities.
4
- class Zone < Entity
5
-
6
- end
7
-
8
- end