diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2023-11-08 21:59:40 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2023-11-08 21:59:40 +0100 |
commit | 23781f394d16c84d761a1b9fa3ad1e65576a2a82 (patch) | |
tree | 468ddbcf482b2a8aba1660c12a485ed306846dbd /lib | |
parent | 0c8b3c3000b565af71961dbf5cbb058ccfe9fd04 (diff) | |
download | colonial-twilight-23781f394d16c84d761a1b9fa3ad1e65576a2a82.zip colonial-twilight-23781f394d16c84d761a1b9fa3ad1e65576a2a82.tar.gz |
Spaces : add #resettled? and #shift_terror(n) and specs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/colonial_twilight/spaces.rb | 12 |
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 |