gamefic 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gamefic/plot.rb +15 -30
- data/lib/gamefic/story.rb +14 -0
- data/lib/gamefic.rb +1 -0
- metadata +3 -3
- data/lib/gamefic/entity_ext/zone.rb +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d8b026aaef618411c88290ed37d4eec962d91cd
|
4
|
+
data.tar.gz: c441f836978528d55d6a8dc856a62c889c62af7b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
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
|
data/lib/gamefic.rb
CHANGED
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.
|
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-
|
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:
|