From 92109d514165f8eb526c1ec48ade0a078a00c503 Mon Sep 17 00:00:00 2001 From: Jeremy Saklad Date: Tue, 3 Aug 2021 12:24:53 -0500 Subject: [PATCH] Move Adjustment to different file --- Bone Market Solver.py | 26 +------------------------- data/adjustments.py | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 25 deletions(-) create mode 100644 data/adjustments.py diff --git a/Bone Market Solver.py b/Bone Market Solver.py index 11b059d..0d7654c 100644 --- a/Bone Market Solver.py +++ b/Bone Market Solver.py @@ -11,6 +11,7 @@ from os import cpu_count from ortools.sat.python import cp_model +from data.adjustments import Adjustment from data.appendages import Appendage from data.costs import Cost from data.skulls import Skull @@ -70,31 +71,6 @@ cp_model.CpModel.AddGeneralMultiplicationEquality = AddGeneralMultiplicationEqua del AddGeneralMultiplicationEquality -class Adjustment(Enum): - """An action that is taken after all parts have been added to a skeleton.""" - - CARVE_AWAY_AGE = Action( - "Carve away some evidence of age", - cost = Cost.ACTION.value, - antiquity = -2 - ) - - DISGUISE_AMALGAMY = Action( - "Disguise the amalgamy of this piece", - cost = Cost.ACTION.value + 25*Cost.JADE_FRAGMENT.value, - amalgamy = -2 - ) - - MAKE_LESS_DREADFUL = Action( - "Make your skeleton less dreadful", - cost = Cost.ACTION.value, - menace = -2 - ) - - def __str__(self): - return str(self.value) - - class Declaration(Enum): """An action that is taken after all adjustments have been made to a skeleton.""" diff --git a/data/adjustments.py b/data/adjustments.py new file mode 100644 index 0000000..6337820 --- /dev/null +++ b/data/adjustments.py @@ -0,0 +1,28 @@ +from enum import Enum + +from data.costs import Cost +from objects.action import Action + +class Adjustment(Enum): + """An action that is taken after all parts have been added to a skeleton.""" + + CARVE_AWAY_AGE = Action( + "Carve away some evidence of age", + cost = Cost.ACTION.value, + antiquity = -2 + ) + + DISGUISE_AMALGAMY = Action( + "Disguise the amalgamy of this piece", + cost = Cost.ACTION.value + 25*Cost.JADE_FRAGMENT.value, + amalgamy = -2 + ) + + MAKE_LESS_DREADFUL = Action( + "Make your skeleton less dreadful", + cost = Cost.ACTION.value, + menace = -2 + ) + + def __str__(self): + return str(self.value)