twisty 0.2.0 → 0.2.1

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
  SHA256:
3
- metadata.gz: 5f1c781f539f60e786f679974578998bf0e1b69eff21b8980804c0ba150f58c3
4
- data.tar.gz: 69602ce2bcf7579e85da60bc16c312f64da7818eb339f0a92be5febce647371e
3
+ metadata.gz: 5d82a8fe468f0ea13997cbf99bfdcf6bf107bd537da41469fd144e54c4315643
4
+ data.tar.gz: 1847ac26d0ee8ec37296719d518a5f028316c815cde2888f8f55b1d429bbe2e5
5
5
  SHA512:
6
- metadata.gz: 30207c2da3be170aa87713345ca975b8b366dc8aaa07609aed96f39a14a0603e4cad29c3e50f63f623364eb8ba835c4b712721004a5a445c67c91af544cd17f1
7
- data.tar.gz: 9b47d15f50b238caf7844ceda7bc324574d559820398752ee4e78853506d45837869d6fccacd9091b5507fcef049e740908d37e1879a025e0858365bf9f82ffb
6
+ metadata.gz: 60818bc391fc5fba03439a94c3bcf6c74c59f104fd492fe28a0927bcf45088da715f79d949d837f774aaea56e615843075dad7cb5c825a8d1f10d620dc464d26
7
+ data.tar.gz: f966c0d7b367370ce681f6174b88b38a20c23b789f0f6ae5d6c73098ae11cf2cc4dc8d7ced7914327849224bdd4412ed10739d58668ec6d611d600604e63b6c7
data/lib/twisty.rb CHANGED
@@ -55,7 +55,7 @@ Engine.instance.define_command(
55
55
  if engine.inventory.size == 0
56
56
  puts "You are currently carrying nothing"
57
57
  else
58
- puts "You are currently carring: "
58
+ puts "You are currently carrying: "
59
59
  engine.inventory.each{|id| puts engine.items[id].name}
60
60
  end
61
61
  end
data/lib/twisty/engine.rb CHANGED
@@ -378,6 +378,8 @@ class Engine
378
378
 
379
379
  current_room.look
380
380
  puts
381
+ @commands[/^inventory$/].exec(["inventory"])
382
+ puts
381
383
 
382
384
  while @playing == true
383
385
  printf "#{current_room.name} > "
data/lib/twisty/room.rb CHANGED
@@ -107,7 +107,11 @@ class Room < Entity
107
107
  if @items.include? id
108
108
  raise GameError.new "Duplicate item in room #{@id}"
109
109
  else
110
- @items << id
110
+ if $engine.items.include? id
111
+ @items << id
112
+ else
113
+ raise GameError.new "Attempt to add invalid item #{id} to room #{@id}"
114
+ end
111
115
  end
112
116
  end
113
117
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twisty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan McCoskrie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-09 00:00:00.000000000 Z
11
+ date: 2018-04-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rtype-native