From 5b76f11bb327fcc4760e89e0c86ec42083049155 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 4 Dec 2023 14:45:28 +0100 Subject: FLNBotRules : clean up --- lib/colonial_twilight/fln_bot_rules.rb | 5 +++-- 1 file 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 -- cgit v1.1-2-g2b99