From 5500a1add4c167d018665d3d1e5f69652f91b0db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 10 Nov 2023 10:54:06 +0100 Subject: spec : complet Mock --- spec/mock_board.rb | 40 ++++++++++++++++++++++++++++++++++++++-- 1 file 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 -- cgit v1.1-2-g2b99