diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2023-11-10 10:54:06 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2023-11-10 10:54:06 +0100 |
commit | 5500a1add4c167d018665d3d1e5f69652f91b0db (patch) | |
tree | f7a8398c0503268b526d669a82d33199e3ca3b5f /spec/mock_board.rb | |
parent | 3f31995d084dd74f91808dc553dd328516a8b8f9 (diff) | |
download | colonial-twilight-5500a1add4c167d018665d3d1e5f69652f91b0db.zip colonial-twilight-5500a1add4c167d018665d3d1e5f69652f91b0db.tar.gz |
spec : complet Mock
Diffstat (limited to 'spec/mock_board.rb')
-rw-r--r-- | spec/mock_board.rb | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/spec/mock_board.rb b/spec/mock_board.rb index 2ea3899..aed32c1 100644 --- a/spec/mock_board.rb +++ b/spec/mock_board.rb @@ -45,6 +45,10 @@ class Sector @data[:terror] || 0 end + def terror? + terror.positive? + end + def pop @data[:pop] || 0 end @@ -70,7 +74,7 @@ class Sector end def gov_cubes - @data[:gov_cubes] || 0 + @data[:gov_cubes] || (french_cubes + algerian_cubes) end def gov_bases @@ -81,12 +85,44 @@ class Sector gov_cubes + gov_bases end + def troops + @data[:troops] || (french_troops + algerian_troops) + end + + def police + @data[:police] || (french_police + algerian_police) + end + + def french_cubes + french_police + french_troops + end + + def french_police + @data[:french_police] || 0 + end + + def french_troops + @data[:french_troops] || 0 + end + + def algerian_cubes + algerian_police + algerian_troops + end + + def algerian_police + @data[:algerian_police] || 0 + end + + def algerian_troops + @data[:algerian_troops] || 0 + end + def fln_control? fln > gov end def gov_control? - gov < fln + gov > fln end end |