gamefic 3.0.0 → 3.2.0
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 +4 -4
- data/CHANGELOG.md +14 -1
- data/lib/gamefic/action.rb +9 -1
- data/lib/gamefic/active/epic.rb +8 -3
- data/lib/gamefic/active/messaging.rb +2 -0
- data/lib/gamefic/active/take.rb +3 -5
- data/lib/gamefic/active.rb +32 -13
- data/lib/gamefic/command.rb +4 -15
- data/lib/gamefic/composer.rb +70 -0
- data/lib/gamefic/dispatcher.rb +47 -40
- data/lib/gamefic/entity.rb +3 -5
- data/lib/gamefic/expression.rb +31 -0
- data/lib/gamefic/plot.rb +1 -1
- data/lib/gamefic/props/default.rb +10 -4
- data/lib/gamefic/props/output.rb +107 -0
- data/lib/gamefic/props/pause.rb +2 -0
- data/lib/gamefic/props.rb +1 -0
- data/lib/gamefic/query/base.rb +24 -0
- data/lib/gamefic/query/general.rb +4 -0
- data/lib/gamefic/query/scoped.rb +5 -0
- data/lib/gamefic/query/text.rb +16 -5
- data/lib/gamefic/response.rb +19 -25
- data/lib/gamefic/rulebook/events.rb +7 -7
- data/lib/gamefic/rulebook.rb +2 -2
- data/lib/gamefic/scanner.rb +54 -25
- data/lib/gamefic/scene/default.rb +3 -3
- data/lib/gamefic/scene/multiple_choice.rb +1 -1
- data/lib/gamefic/scriptable/entities.rb +8 -5
- data/lib/gamefic/scriptable/proxy.rb +13 -0
- data/lib/gamefic/scriptable/queries.rb +2 -2
- data/lib/gamefic/scriptable/scenes.rb +6 -6
- data/lib/gamefic/snapshot.rb +9 -1
- data/lib/gamefic/syntax.rb +4 -4
- data/lib/gamefic/vault.rb +2 -0
- data/lib/gamefic/version.rb +1 -1
- data/lib/gamefic.rb +2 -0
- metadata +5 -2
data/lib/gamefic/syntax.rb
CHANGED
@@ -61,12 +61,12 @@ module Gamefic
|
|
61
61
|
# Convert a String into a Command.
|
62
62
|
#
|
63
63
|
# @param text [String]
|
64
|
-
# @return [
|
64
|
+
# @return [Expression, nil]
|
65
65
|
def tokenize text
|
66
66
|
match = text&.match(template.regexp)
|
67
67
|
return nil unless match
|
68
68
|
|
69
|
-
|
69
|
+
Expression.new(verb, match_to_args(match))
|
70
70
|
end
|
71
71
|
|
72
72
|
# Determine if the specified text matches the syntax's expected pattern.
|
@@ -94,7 +94,7 @@ module Gamefic
|
|
94
94
|
#
|
95
95
|
# @param text [String] The text to tokenize.
|
96
96
|
# @param syntaxes [Array<Syntax>] The syntaxes to use.
|
97
|
-
# @return [Array<
|
97
|
+
# @return [Array<Expression>] The tokenized expressions.
|
98
98
|
def self.tokenize text, syntaxes
|
99
99
|
syntaxes
|
100
100
|
.map { |syn| syn.tokenize(text) }
|
@@ -109,7 +109,7 @@ module Gamefic
|
|
109
109
|
end
|
110
110
|
|
111
111
|
# @param string [String]
|
112
|
-
# @return [
|
112
|
+
# @return [Symbol, nil]
|
113
113
|
def self.literal_or_nil string
|
114
114
|
string.start_with?(':') ? nil : string.to_sym
|
115
115
|
end
|
data/lib/gamefic/vault.rb
CHANGED
data/lib/gamefic/version.rb
CHANGED
data/lib/gamefic.rb
CHANGED
@@ -11,6 +11,7 @@ require 'gamefic/rulebook'
|
|
11
11
|
require 'gamefic/query'
|
12
12
|
require 'gamefic/scanner'
|
13
13
|
require 'gamefic/scope'
|
14
|
+
require 'gamefic/expression'
|
14
15
|
require 'gamefic/command'
|
15
16
|
require 'gamefic/action'
|
16
17
|
require 'gamefic/props'
|
@@ -27,6 +28,7 @@ require 'gamefic/node'
|
|
27
28
|
require 'gamefic/describable'
|
28
29
|
require 'gamefic/messenger'
|
29
30
|
require 'gamefic/entity'
|
31
|
+
require 'gamefic/composer'
|
30
32
|
require 'gamefic/dispatcher'
|
31
33
|
require 'gamefic/active'
|
32
34
|
require 'gamefic/active/cue'
|
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: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fred Snyder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-04-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opal
|
@@ -136,11 +136,13 @@ files:
|
|
136
136
|
- lib/gamefic/actor.rb
|
137
137
|
- lib/gamefic/block.rb
|
138
138
|
- lib/gamefic/command.rb
|
139
|
+
- lib/gamefic/composer.rb
|
139
140
|
- lib/gamefic/core_ext/array.rb
|
140
141
|
- lib/gamefic/core_ext/string.rb
|
141
142
|
- lib/gamefic/describable.rb
|
142
143
|
- lib/gamefic/dispatcher.rb
|
143
144
|
- lib/gamefic/entity.rb
|
145
|
+
- lib/gamefic/expression.rb
|
144
146
|
- lib/gamefic/logging.rb
|
145
147
|
- lib/gamefic/messenger.rb
|
146
148
|
- lib/gamefic/narrative.rb
|
@@ -149,6 +151,7 @@ files:
|
|
149
151
|
- lib/gamefic/props.rb
|
150
152
|
- lib/gamefic/props/default.rb
|
151
153
|
- lib/gamefic/props/multiple_choice.rb
|
154
|
+
- lib/gamefic/props/output.rb
|
152
155
|
- lib/gamefic/props/pause.rb
|
153
156
|
- lib/gamefic/props/yes_or_no.rb
|
154
157
|
- lib/gamefic/query.rb
|