summaryrefslogtreecommitdiffstats
path: root/lib/colonial_twilight/fln_rules.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-09-23 12:13:11 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2023-09-23 12:13:11 +0200
commitb21d125966e118914f0442f322eebc298be78824 (patch)
tree1883ec0d922675d4179ef126b9c12df4b6571bda /lib/colonial_twilight/fln_rules.rb
parentfcb4a526a76e0e8464fc42a92145fe0ed149026b (diff)
downloadcolonial-twilight-b21d125966e118914f0442f322eebc298be78824.zip
colonial-twilight-b21d125966e118914f0442f322eebc298be78824.tar.gz
FLNRules : support agitate
Diffstat (limited to 'lib/colonial_twilight/fln_rules.rb')
-rw-r--r--lib/colonial_twilight/fln_rules.rb13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/colonial_twilight/fln_rules.rb b/lib/colonial_twilight/fln_rules.rb
index fa07805..dac834b 100644
--- a/lib/colonial_twilight/fln_rules.rb
+++ b/lib/colonial_twilight/fln_rules.rb
@@ -1,10 +1,11 @@
#! /usr/bin/env ruby
# frozen_string_literal: true
+# rubocop:disable Style/Documentation
+#
module ColonialTwilight
- # general rules governing operations and activities
module FLNRules
- # Rally 3.3.1
+ # Rally 3.3.1 + France Track
def may_rally_in?(space)
(space.sector? || (space.city? && !space.support?) || (space.country? && space.independent?))
end
@@ -13,6 +14,14 @@ module ColonialTwilight
board.search { |s| may_rally_in? s }
end
+ def may_agitate_in?(space)
+ (!space.country? && (space.fln_control? || space.fln_bases.positive?))
+ end
+
+ def agitate_spaces(spaces)
+ spaces.select { |s| may_agitate_in? s }
+ end
+
# March 3.3.2
# Attack 3.3.3