inform6lib 0.0.6 → 0.1.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/Rakefile +2 -2
- data/lib/inform/English.h.rb +5 -5
- data/lib/inform/VerbLib.h.rb +1 -1
- data/lib/inform/parserm.h.rb +6 -9
- data/lib/inform/verblibm.h.rb +39 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d9f1deb9cf509ad1583e444225fae2d0e94aeee6a150844e83b39818ffae1792
|
|
4
|
+
data.tar.gz: cf1bf259e26d5496ed8bd6d1e2daeeebdc8df95915e61d66a90a6646def02c68
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 32ee527e72c9648a864e2f4f0d06a750d92e8835c3954118d7a5283c636ec7e701ac81d13768f04c602753fb12cc27d2df0f4980f98a0e0abb1ea17b4eb6ff70
|
|
7
|
+
data.tar.gz: 615afb3f2854063b9964289e720290124c9196bd692c5b576de3cd8542ce7c501117407106426d895a5efbea48de49647f62d42f302bec7a372fd37225900499
|
data/Rakefile
CHANGED
|
@@ -10,8 +10,8 @@ require 'rake/clean'
|
|
|
10
10
|
unless defined?(Inform6Lib::PROJECT)
|
|
11
11
|
# Ensure Inform6Lib module constants
|
|
12
12
|
module Inform6Lib
|
|
13
|
-
SUFFIX = '-ruby'.freeze unless defined?(
|
|
14
|
-
PROJECT = File.basename(__dir__,
|
|
13
|
+
SUFFIX = '-ruby'.freeze unless defined?(SUFFIX)
|
|
14
|
+
PROJECT = File.basename(File.expand_path(__dir__), SUFFIX)
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
data/lib/inform/English.h.rb
CHANGED
|
@@ -66,7 +66,7 @@ module English
|
|
|
66
66
|
# ------------------------------------------------------------------------------
|
|
67
67
|
|
|
68
68
|
# The CompassDirection class
|
|
69
|
-
class CompassDirection < Inform::
|
|
69
|
+
class CompassDirection < Inform::Ephemeral::Object
|
|
70
70
|
def initialize(name, number = 0, article = "the")
|
|
71
71
|
super(name)
|
|
72
72
|
@number = number
|
|
@@ -75,7 +75,7 @@ module English
|
|
|
75
75
|
end
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
Compass = Inform::
|
|
78
|
+
Compass = Inform::Ephemeral::Object.new "compass"
|
|
79
79
|
Compass.has :concealed
|
|
80
80
|
|
|
81
81
|
Compass > $n_obj = CompassDirection.new("north") {
|
|
@@ -1268,9 +1268,9 @@ if defined? Inform::Object
|
|
|
1268
1268
|
include Inform::English
|
|
1269
1269
|
end
|
|
1270
1270
|
|
|
1271
|
-
# The Inform::
|
|
1272
|
-
module
|
|
1273
|
-
# The Inform::
|
|
1271
|
+
# The Inform::Ephemeral module
|
|
1272
|
+
module Ephemeral
|
|
1273
|
+
# The Inform::Ephemeral::Object class to include the English module
|
|
1274
1274
|
class Object
|
|
1275
1275
|
include Inform::English
|
|
1276
1276
|
end
|
data/lib/inform/VerbLib.h.rb
CHANGED
data/lib/inform/parserm.h.rb
CHANGED
|
@@ -504,7 +504,7 @@ module Parser
|
|
|
504
504
|
# location-name on the status line can be "Darkness".
|
|
505
505
|
# ----------------------------------------------------------------------------
|
|
506
506
|
|
|
507
|
-
Darkness = Inform::
|
|
507
|
+
Darkness = Inform::Ephemeral::Object.new "(darkness object)"
|
|
508
508
|
Darkness.with do
|
|
509
509
|
def short_name; DARKNESS__TX; end
|
|
510
510
|
def description; L__M(:Miscellany, 17); end
|
|
@@ -574,7 +574,7 @@ module Parser
|
|
|
574
574
|
#
|
|
575
575
|
# ----------------------------------------------------------------------------
|
|
576
576
|
|
|
577
|
-
# InformParser = Inform::
|
|
577
|
+
# InformParser = Inform::Ephemeral::Object.new "(Inform Parser)"
|
|
578
578
|
# def InformParser.parse_input; Parser__parse(); end
|
|
579
579
|
# InformParser.has :proper
|
|
580
580
|
|
|
@@ -4676,7 +4676,7 @@ module Parser
|
|
|
4676
4676
|
|
|
4677
4677
|
# artform = LanguageArticles
|
|
4678
4678
|
# + 3*WORDSIZE*LanguageContractionForms*(short_name_case + i*LanguageCases);You can see acode: 2
|
|
4679
|
-
# TODO: Remove
|
|
4679
|
+
# TODO: Remove
|
|
4680
4680
|
# print "acode: ", acode, "^";
|
|
4681
4681
|
# print "artform-->acode: ", (string) (artform-->acode), "^";
|
|
4682
4682
|
# print "artform-->0: ", (string) (artform-->0), "^";
|
|
@@ -5174,13 +5174,10 @@ end
|
|
|
5174
5174
|
|
|
5175
5175
|
# The InformLibrary class.
|
|
5176
5176
|
# Inform 6 defines this as an Object.
|
|
5177
|
-
class InformLibrary < Inform::
|
|
5177
|
+
class InformLibrary < Inform::Ephemeral::Object
|
|
5178
5178
|
REGISTRY = Struct.new(:memo).new(defined?(Java) ? java.util.concurrent.ConcurrentHashMap.new : {})
|
|
5179
|
-
include Inform::Context
|
|
5180
|
-
include Inform::StdLib
|
|
5181
|
-
include Inform::Parser
|
|
5182
5179
|
include Inform::Rules
|
|
5183
|
-
include Inform::
|
|
5180
|
+
include Inform::Parser
|
|
5184
5181
|
|
|
5185
5182
|
attr_accessor :player
|
|
5186
5183
|
|
|
@@ -5842,7 +5839,7 @@ module Inform
|
|
|
5842
5839
|
end
|
|
5843
5840
|
|
|
5844
5841
|
# The LibExt class
|
|
5845
|
-
class LibExt < Inform::
|
|
5842
|
+
class LibExt < Inform::Ephemeral::Object
|
|
5846
5843
|
attr_accessor :ext_initialise, :ext_messages
|
|
5847
5844
|
|
|
5848
5845
|
def init
|
data/lib/inform/verblibm.h.rb
CHANGED
|
@@ -1034,7 +1034,7 @@ module Verbs
|
|
|
1034
1034
|
# of using Netty.
|
|
1035
1035
|
def YesOrNo
|
|
1036
1036
|
loop do
|
|
1037
|
-
@input =
|
|
1037
|
+
@input = __read
|
|
1038
1038
|
DrawStatusLine() if !location.nil? && !parent(@player).nil?
|
|
1039
1039
|
j = @input
|
|
1040
1040
|
unless @input.empty? # at least one word entered
|
|
@@ -1049,7 +1049,43 @@ module Verbs
|
|
|
1049
1049
|
# TODO: How could this work in a non-blocking IO system? FIXME
|
|
1050
1050
|
def QuitSub
|
|
1051
1051
|
L__M(:Quit, 2)
|
|
1052
|
-
|
|
1052
|
+
__quit if YesOrNo()
|
|
1053
|
+
end
|
|
1054
|
+
|
|
1055
|
+
def RestartSub
|
|
1056
|
+
L__M(:Restart, 1)
|
|
1057
|
+
__restart if YesOrNo()
|
|
1058
|
+
end
|
|
1059
|
+
|
|
1060
|
+
def RestoreSub
|
|
1061
|
+
return if self.respond_to?(:__restore) && __restore(self.method(:RMaybe))
|
|
1062
|
+
L__M(:Restore, 1)
|
|
1063
|
+
end
|
|
1064
|
+
|
|
1065
|
+
def RMaybe
|
|
1066
|
+
L__M(:Restore, 2)
|
|
1067
|
+
end
|
|
1068
|
+
|
|
1069
|
+
def SaveSub
|
|
1070
|
+
return if self.respond_to?(:__save) && __save(self.method(:SMaybe))
|
|
1071
|
+
L__M(:Save, 1)
|
|
1072
|
+
end
|
|
1073
|
+
|
|
1074
|
+
def SMaybe
|
|
1075
|
+
L__M(:Save, 2)
|
|
1076
|
+
end
|
|
1077
|
+
|
|
1078
|
+
def VerifySub
|
|
1079
|
+
return if self.respond_to?(:__verify) && __verify(self.method(:Vmaybe))
|
|
1080
|
+
Vwrong()
|
|
1081
|
+
end
|
|
1082
|
+
|
|
1083
|
+
def Vmaybe
|
|
1084
|
+
L__M(:Verify, 1)
|
|
1085
|
+
end
|
|
1086
|
+
|
|
1087
|
+
def Vwrong
|
|
1088
|
+
L__M(:Verify, 2)
|
|
1053
1089
|
end
|
|
1054
1090
|
|
|
1055
1091
|
def NotifyOnSub; notify_mode = 1; L__M(:NotifyOn); end
|
|
@@ -2363,7 +2399,7 @@ module Verbs
|
|
|
2363
2399
|
# ----------------------------------------------------------------------------
|
|
2364
2400
|
|
|
2365
2401
|
def XTestMove(obj, dest)
|
|
2366
|
-
if obj.is_a?(InformLibrary) || obj == LibraryMessages || obj.is_a?(Inform::
|
|
2402
|
+
if obj.is_a?(InformLibrary) || obj == LibraryMessages || obj.is_a?(Inform::Ephemeral::Object)
|
|
2367
2403
|
println "[Can't move #{obj.name}: it's a system object.]"
|
|
2368
2404
|
return true
|
|
2369
2405
|
end
|