From 7f750f8dab6c18d35ea48184b96d0d20b6f403e8 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Tue, 3 Aug 2021 12:31:20 -0500 Subject: [PATCH] Move Declaration to different file --- Bone Market Solver.py | 64 +---------------------------------------- data/declarations.py | 66 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 63 deletions(-) create mode 100644 data/declarations.py diff --git a/Bone Market Solver.py b/Bone Market Solver.py index 0d7654c..95ec549 100644 --- a/Bone Market Solver.py +++ b/Bone Market Solver.py @@ -14,6 +14,7 @@ from ortools.sat.python import cp_model from data.adjustments import Adjustment from data.appendages import Appendage from data.costs import Cost +from data.declarations import Declaration from data.skulls import Skull from data.torsos import Torso from objects.action import Action @@ -71,69 +72,6 @@ cp_model.CpModel.AddGeneralMultiplicationEquality = AddGeneralMultiplicationEqua del AddGeneralMultiplicationEquality -class Declaration(Enum): - """An action that is taken after all adjustments have been made to a skeleton.""" - - AMPHIBIAN = Action( - "Declare your (Skeleton Type) a completed Amphibian", - cost = Cost.ACTION.value - ) - - APE = Action( - "Declare your (Skeleton Type) a completed Ape", - cost = Cost.ACTION.value - ) - - BIRD = Action( - "Declare your (Skeleton Type) a completed Bird", - cost = Cost.ACTION.value - ) - - CHIMERA = Action( - "Declare your (Skeleton Type) a completed Chimera", - cost = Cost.ACTION.value, - implausibility = 3 - ) - - CURATOR = Action( - "Declare your (Skeleton Type) a completed Curator", - cost = Cost.ACTION.value - ) - - FISH = Action( - "Declare your (Skeleton Type) a completed Fish", - cost = Cost.ACTION.value - ) - - HUMANOID = Action( - "Declare your (Skeleton Type) a completed Humanoid", - cost = Cost.ACTION.value - ) - - INSECT = Action( - "Declare your (Skeleton Type) a completed Insect", - cost = Cost.ACTION.value - ) - - MONKEY = Action( - "Declare your (Skeleton Type) a completed Monkey", - cost = Cost.ACTION.value - ) - - REPTILE = Action( - "Declare your (Skeleton Type) a completed Reptile", - cost = Cost.ACTION.value - ) - - SPIDER = Action( - "Declare your (Skeleton Type) a completed Spider", - cost = Cost.ACTION.value - ) - - def __str__(self): - return str(self.value) - - class Embellishment(Enum): """An action is taken after a declaration has been made for a skeleton.""" diff --git a/data/declarations.py b/data/declarations.py new file mode 100644 index 0000000..12ccbf0 --- /dev/null +++ b/data/declarations.py @@ -0,0 +1,66 @@ +from enum import Enum + +from data.costs import Cost +from objects.action import Action + +class Declaration(Enum): + """An action that is taken after all adjustments have been made to a skeleton.""" + + AMPHIBIAN = Action( + "Declare your (Skeleton Type) a completed Amphibian", + cost = Cost.ACTION.value + ) + + APE = Action( + "Declare your (Skeleton Type) a completed Ape", + cost = Cost.ACTION.value + ) + + BIRD = Action( + "Declare your (Skeleton Type) a completed Bird", + cost = Cost.ACTION.value + ) + + CHIMERA = Action( + "Declare your (Skeleton Type) a completed Chimera", + cost = Cost.ACTION.value, + implausibility = 3 + ) + + CURATOR = Action( + "Declare your (Skeleton Type) a completed Curator", + cost = Cost.ACTION.value + ) + + FISH = Action( + "Declare your (Skeleton Type) a completed Fish", + cost = Cost.ACTION.value + ) + + HUMANOID = Action( + "Declare your (Skeleton Type) a completed Humanoid", + cost = Cost.ACTION.value + ) + + INSECT = Action( + "Declare your (Skeleton Type) a completed Insect", + cost = Cost.ACTION.value + ) + + MONKEY = Action( + "Declare your (Skeleton Type) a completed Monkey", + cost = Cost.ACTION.value + ) + + REPTILE = Action( + "Declare your (Skeleton Type) a completed Reptile", + cost = Cost.ACTION.value + ) + + SPIDER = Action( + "Declare your (Skeleton Type) a completed Spider", + cost = Cost.ACTION.value + ) + + def __str__(self): + return str(self.value)