Define DiplomatFascination functionally

Rather than laboriously replicating every fascination the Trifling
Diplomat has, the script now exploits the consistent member names to
generate the list automatically.

This should not have any effect on usage, but will ease future
maintainance.
This commit is contained in:
Jeremy Saklad 2021-07-06 12:18:49 -05:00
parent 9b7162527d
commit 673b6160c6
Signed by: Jeremy Saklad
GPG Key ID: 9CA2149583EDBF84
1 changed files with 7 additions and 6 deletions

View File

@ -1194,12 +1194,13 @@ class OccasionalBuyer(Enum):
AN_INGENUOUS_MALACOLOGIST = [Buyer.AN_INGENUOUS_MALACOLOGIST] AN_INGENUOUS_MALACOLOGIST = [Buyer.AN_INGENUOUS_MALACOLOGIST]
class DiplomatFascination(Enum): DiplomatFascination = Enum(
"""The current requirements of the Trifling Diplomat.""" 'DiplomatFascination',
( (diplomat.name[22:], diplomat) for diplomat in Buyer
ANTIQUITY = Buyer.THE_TRIFLING_DIPLOMAT_ANTIQUITY if diplomat.name.startswith('THE_TRIFLING_DIPLOMAT_') ),
module = __name__
FISH = Buyer.THE_TRIFLING_DIPLOMAT_FISH )
DiplomatFascination.__doc__ = "The current fascination of the Trifling Diplomat."
def Solve(shadowy_level, bone_market_fluctuations, zoological_mania, occasional_buyer = None, diplomat_fascination = None, desired_buyers = [], maximum_cost = cp_model.INT32_MAX, maximum_exhaustion = cp_model.INT32_MAX, time_limit = float('inf'), workers = cpu_count(), stdscr = None): def Solve(shadowy_level, bone_market_fluctuations, zoological_mania, occasional_buyer = None, diplomat_fascination = None, desired_buyers = [], maximum_cost = cp_model.INT32_MAX, maximum_exhaustion = cp_model.INT32_MAX, time_limit = float('inf'), workers = cpu_count(), stdscr = None):