software_challenge_client 1.0.0 → 1.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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f894ec8a43e2caa45c9773bfe4f8ef966b95583
|
4
|
+
data.tar.gz: 681466cbca4293e50641de66564dbf13379a3e3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2b6c4cb186b805758336139e4527994de33e10bcda8389c27a83da9c79abc39aedb82df96b759b26ebcad76c5ba6965d8487e982fdaa187af47bb42794074fb
|
7
|
+
data.tar.gz: 742a795eb16528f7809620c2101af4b636dfaad6b5fb81065c9b60847ad92dc9963b2ae981e2d3ab5b678c0798478a1015c3279be3a4e803ff05025efd55636f
|
data/RELEASES.md
CHANGED
@@ -135,6 +135,10 @@ class Skip < Action
|
|
135
135
|
def ==(other)
|
136
136
|
other.type == type
|
137
137
|
end
|
138
|
+
|
139
|
+
def perform!(_gamestate)
|
140
|
+
# does nothing
|
141
|
+
end
|
138
142
|
end
|
139
143
|
|
140
144
|
# Eine Salatessen-Aktion. Kann nur auf einem Salatfeld ausgeführt werden. Muss ausgeführt werden,
|
@@ -153,6 +157,21 @@ class EatSalad < Action
|
|
153
157
|
def ==(other)
|
154
158
|
other.type == type
|
155
159
|
end
|
160
|
+
|
161
|
+
def perform!(gamestate)
|
162
|
+
valid, msg = GameRules.is_valid_to_eat(gamestate)
|
163
|
+
if valid
|
164
|
+
gamestate.current_player.salads -= 1
|
165
|
+
if gamestate.is_first(gamestate.current_player)
|
166
|
+
gamestate.current_player.carrots += 10
|
167
|
+
else
|
168
|
+
gamestate.current_player.carrots += 30
|
169
|
+
end
|
170
|
+
gamestate.set_last_action(self)
|
171
|
+
else
|
172
|
+
invalid(msg)
|
173
|
+
end
|
174
|
+
end
|
156
175
|
end
|
157
176
|
|
158
177
|
# Karottentauschaktion. Es können auf einem Karottenfeld 10 Karotten abgegeben oder aufgenommen werden.
|
@@ -166,7 +185,7 @@ class ExchangeCarrots < Action
|
|
166
185
|
|
167
186
|
def perform!(gamestate)
|
168
187
|
valid, message = GameRules.is_valid_to_exchange_carrots(gamestate, value)
|
169
|
-
|
188
|
+
invalid("Es können nicht #{value} Karotten aufgenommen werden. " + message) unless valid
|
170
189
|
gamestate.current_player.carrots += value
|
171
190
|
gamestate.set_last_action(self)
|
172
191
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: software_challenge_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- 'kwollw '
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-08-
|
13
|
+
date: 2017-08-30 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: typesafe_enum
|
@@ -297,3 +297,4 @@ specification_version: 4
|
|
297
297
|
summary: This gem provides functions to build a client for the coding competition
|
298
298
|
Software-Challenge 2017.
|
299
299
|
test_files: []
|
300
|
+
has_rdoc:
|