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 +4 -4
- data/lib/twisty.rb +1 -1
- data/lib/twisty/engine.rb +2 -0
- data/lib/twisty/room.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d82a8fe468f0ea13997cbf99bfdcf6bf107bd537da41469fd144e54c4315643
|
4
|
+
data.tar.gz: 1847ac26d0ee8ec37296719d518a5f028316c815cde2888f8f55b1d429bbe2e5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
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
|
-
|
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.
|
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-
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rtype-native
|