adventure_rl 0.0.1.pre.ld42 → 0.0.2

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
  SHA256:
3
- metadata.gz: 419aead10a1f774fe22958d32dc028016f1176fd9aaa7ed5774c2cfec570f6c6
4
- data.tar.gz: b360c7689d0e920376812f90f1e600b8402d5a02e2271e22389ac7ef61778926
3
+ metadata.gz: f119d674929319ed47349030b7887b7e4d7c235d9326016110b05a4646917775
4
+ data.tar.gz: 953fe951499ce5ffb943f6b6a778420de4afe704580fb821c7c9bd669c02fce9
5
5
  SHA512:
6
- metadata.gz: 3370836de93da89533476f2f828d086e630d9d143fb5ba03a9cfa30d536f28455a5f6343c7def30fcc4bb77e10d9dc9e77e5e9c051537022efa8100d6ab2e003
7
- data.tar.gz: 1507a166dae00060b1d2d0d1fb467d671b7663eca6fbdc2bb0387216b52f2e8db69b9b3e8fe459724f5a87190ddbd1544e23a8e1af16e13bf38cac426cd2958a
6
+ metadata.gz: 6aeb0ede7fa9b9343d016e23dc706ea6a137958e34a700f4a8b63721f7a3901ca8c28ad4b8223434b53cacee2d067205ed9d2c6f5b5f0fd90ac39cb1938a45b8
7
+ data.tar.gz: ff28666b4841a4ddab127b084db82274f8eea9afa41d92995fda004662aa4d7014232d9a1e66db5adbbff3c24db2525514dc25b19195d1de7f80cd2a58c5333e
data/.gitignore CHANGED
@@ -7,6 +7,7 @@
7
7
  /tmp/
8
8
  /rdoc/
9
9
 
10
+ /Gemfile.lock
10
11
  .byebug_history
11
12
  .virb/
12
13
  /ignore/
@@ -50,10 +50,10 @@ module AdventureRL
50
50
  btns.flatten.each do |button|
51
51
  if (button.is_a?(Symbol) || button.is_a?(String))
52
52
  validate_button button
53
- btnid = Gosu.char_to_button_id button
53
+ btnids = [Gosu.char_to_button_id(button), get_button_constants(button)].flatten.compact
54
54
  pressable_button = {
55
55
  name: button,
56
- ids: [btnid]
56
+ ids: btnids
57
57
  }
58
58
  @pressable_buttons << pressable_button unless (@pressable_buttons.include? pressable_button)
59
59
  elsif (button.is_a?(Hash))
@@ -62,8 +62,8 @@ module AdventureRL
62
62
  name: btn_name,
63
63
  ids: [btn_buttons].flatten.map do |btn|
64
64
  validate_button btn
65
- next Gosu.char_to_button_id btn
66
- end
65
+ next [Gosu.char_to_button_id(btn), get_button_constants(btn)].compact
66
+ end .flatten
67
67
  }
68
68
  @pressable_buttons << pressable_button unless (@pressable_buttons.include? pressable_button)
69
69
  end
@@ -176,7 +176,15 @@ module AdventureRL
176
176
  Helpers::Error.error(
177
177
  "Passed invalid button character. Expected a printable alphanumeric, but got",
178
178
  "`#{btn.inspect}:#{btn.class.name}'."
179
- ) unless (Gosu.char_to_button_id btn)
179
+ ) unless (Gosu.char_to_button_id(btn) || get_button_constants(btn))
180
+ end
181
+
182
+ def get_button_constants btn
183
+ return Gosu.constants.map do |constant_name|
184
+ constant = Gosu.const_get constant_name
185
+ next constant if (constant_name.to_s.sub(/^(KB_|MS_|GP_)/,'').downcase == btn.downcase && constant_name.match?(/_/))
186
+ next nil
187
+ end .flatten.compact
180
188
  end
181
189
 
182
190
  def get_semantic_button_name btnid
@@ -118,7 +118,7 @@ module AdventureRL
118
118
  previous_precision_over_performance = @precision_over_performance.dup
119
119
  opts = args.last.is_a?(Hash) ? args.last : nil
120
120
 
121
- @precision_over_performance = opts[:precision_over_performance] if (opts.key? :precision_over_performance)
121
+ @precision_over_performance = opts[:precision_over_performance] if (opts && opts.key?(:precision_over_performance))
122
122
 
123
123
  if ([:highest].include? @precision_over_performance)
124
124
  move_by_steps incremental_position
@@ -160,6 +160,7 @@ module AdventureRL
160
160
  private
161
161
 
162
162
  def parse_position *args
163
+ args.flatten!
163
164
  position = {}
164
165
  args[0] = args[0].get_position if (args[0].is_a? Point)
165
166
  case args.size
@@ -1,3 +1,3 @@
1
1
  module AdventureRL
2
- VERSION = '0.0.1-ld42'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adventure_rl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.pre.ld42
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noah Rosenzweig
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-08-13 00:00:00.000000000 Z
11
+ date: 2018-08-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: awesome_print
@@ -156,7 +156,6 @@ files:
156
156
  - ".gitignore"
157
157
  - ".travis.yml"
158
158
  - Gemfile
159
- - Gemfile.lock
160
159
  - LICENSE.txt
161
160
  - README.md
162
161
  - Rakefile
@@ -225,9 +224,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
225
224
  version: '0'
226
225
  required_rubygems_version: !ruby/object:Gem::Requirement
227
226
  requirements:
228
- - - ">"
227
+ - - ">="
229
228
  - !ruby/object:Gem::Version
230
- version: 1.3.1
229
+ version: '0'
231
230
  requirements: []
232
231
  rubyforge_project:
233
232
  rubygems_version: 2.7.7
data/Gemfile.lock DELETED
@@ -1,47 +0,0 @@
1
- GIT
2
- remote: https://github.com/Noah2610/ArgumentParser
3
- revision: 3ac5b0083fd42ae8740d1d22d988f56c74a29470
4
- specs:
5
- argument_parser (1.0.0)
6
-
7
- PATH
8
- remote: .
9
- specs:
10
- adventure_rl (0.0.1.pre.ld42)
11
- gosu (~> 0.13.3)
12
-
13
- GEM
14
- remote: https://rubygems.org/
15
- specs:
16
- awesome_print (1.8.0)
17
- byebug (10.0.2)
18
- docile (1.3.1)
19
- gosu (0.13.3)
20
- json (2.1.0)
21
- minitest (5.11.3)
22
- rake (10.5.0)
23
- rdoc (6.0.4)
24
- simplecov (0.16.1)
25
- docile (~> 1.1)
26
- json (>= 1.8, < 3)
27
- simplecov-html (~> 0.10.0)
28
- simplecov-html (0.10.2)
29
- virb (0.1.1)
30
-
31
- PLATFORMS
32
- ruby
33
-
34
- DEPENDENCIES
35
- adventure_rl!
36
- argument_parser!
37
- awesome_print
38
- bundler (~> 1.16)
39
- byebug
40
- minitest (~> 5.0)
41
- rake (~> 10.0)
42
- rdoc (~> 6.0)
43
- simplecov
44
- virb
45
-
46
- BUNDLED WITH
47
- 1.16.3