From 23781f394d16c84d761a1b9fa3ad1e65576a2a82 Mon Sep 17 00:00:00 2001 From: Jérémy Zurcher Date: Wed, 8 Nov 2023 21:59:40 +0100 Subject: Spaces : add #resettled? and #shift_terror(n) and specs --- lib/colonial_twilight/spaces.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib') 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 -- cgit v1.2.3