summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2023-12-04 14:45:28 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2023-12-04 14:45:28 +0100
commit5b76f11bb327fcc4760e89e0c86ec42083049155 (patch)
tree98adfacf41ecd01cf6f5f0575030cc57a3a2000a /lib
parentc4086c04aa81379a045e5c7b1c0efe09ff38bb75 (diff)
downloadcolonial-twilight-5b76f11bb327fcc4760e89e0c86ec42083049155.zip
colonial-twilight-5b76f11bb327fcc4760e89e0c86ec42083049155.tar.gz
FLNBotRules : clean up
Diffstat (limited to 'lib')
-rw-r--r--lib/colonial_twilight/fln_bot_rules.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/colonial_twilight/fln_bot_rules.rb b/lib/colonial_twilight/fln_bot_rules.rb
index a5e5540..6f83def 100644
--- a/lib/colonial_twilight/fln_bot_rules.rb
+++ b/lib/colonial_twilight/fln_bot_rules.rb
@@ -151,8 +151,9 @@ module ColonialTwilight
end
def rally_9_priority(spaces, resources, &is_rallied)
- f = _filter(spaces) { |s| s.support? && (resources.zero? || (resources - (is_rallied.call(s) ? 0 : 1)) > s.terror) }
- _filter(f) { |s| s.neutral? && (resources.zero? || (resources - (is_rallied.call(s) ? 0 : 1)) > s.terror) }
+ has_resources = ->(s) { resources.zero? || (resources - (is_rallied.call(s) ? 0 : 1)) > s.terror }
+ f = _filter(spaces) { |s| s.support? && has_resources.call(s) }
+ _filter(f) { |s| s.neutral? && has_resources.call(s) }
end
# Extort