summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight/spaces.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-11-08 21:59:40 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2023-11-08 21:59:40 +0100
commit23781f394d16c84d761a1b9fa3ad1e65576a2a82 (patch)
tree468ddbcf482b2a8aba1660c12a485ed306846dbd /lib/colonial_twilight/spaces.rb
parent0c8b3c3000b565af71961dbf5cbb058ccfe9fd04 (diff)
downloadcolonial-twilight-23781f394d16c84d761a1b9fa3ad1e65576a2a82.zip
colonial-twilight-23781f394d16c84d761a1b9fa3ad1e65576a2a82.tar.gz
Spaces : add #resettled? and #shift_terror(n) and specs
Diffstat (limited to 'lib/colonial_twilight/spaces.rb')
-rw-r--r--lib/colonial_twilight/spaces.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/colonial_twilight/spaces.rb b/lib/colonial_twilight/spaces.rb
index 6bf9384..909e9db 100644
--- a/lib/colonial_twilight/spaces.rb
+++ b/lib/colonial_twilight/spaces.rb
@@ -146,9 +146,19 @@ module ColonialTwilight
@forces.add(type, num)
end
+ def shift_terror(num = 1)
+ @terror += num
+
+ raise "terror cant be negative" if @terror.negative?
+ end
+
+ def resettled?
+ @resettled
+ end
+
def resettle!
raise "can't resettle a country " if country?
- raise "can't resettle a sector with a population > 1" if @pop != 1
+ raise "can't resettle a sector with a population =! 1" if @pop != 1
@pop = 0
@resettled = true