Changed FittingSlot to IntEnum
This commit is contained in:
@@ -20,7 +20,8 @@
|
||||
from eos.enum import Enum
|
||||
from enum import IntEnum,unique
|
||||
|
||||
class FittingSlot(Enum):
|
||||
@unique
|
||||
class FittingSlot(IntEnum):
|
||||
"""
|
||||
Contains slots for ship fittings
|
||||
"""
|
||||
|
||||
@@ -25,8 +25,8 @@ import eos.db
|
||||
from eos.effectHandlerHelpers import HandledItem, HandledCharge
|
||||
from eos.modifiedAttributeDict import ModifiedAttributeDict, ItemAttrShortcut, ChargeAttrShortcut
|
||||
from eos.saveddata.fighterAbility import FighterAbility
|
||||
from eos.saveddata.module import FittingSlot
|
||||
from eos.utils.stats import DmgTypes
|
||||
from eos.const import FittingSlot
|
||||
|
||||
pyfalog = Logger(__name__)
|
||||
|
||||
|
||||
@@ -29,12 +29,12 @@ import eos.db
|
||||
from eos import capSim
|
||||
from eos.effectHandlerHelpers import HandledModuleList, HandledDroneCargoList, HandledImplantBoosterList, HandledProjectedDroneList, HandledProjectedModList
|
||||
from eos.enum import Enum
|
||||
from eos.const import ImplantLocation, CalcType
|
||||
from eos.const import ImplantLocation, CalcType, FittingSlot
|
||||
from eos.saveddata.ship import Ship
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.character import Character
|
||||
from eos.saveddata.citadel import Citadel
|
||||
from eos.saveddata.module import Module, FittingModuleState, FittingSlot, FittingHardpoint
|
||||
from eos.saveddata.module import Module, FittingModuleState, FittingHardpoint
|
||||
from eos.utils.stats import DmgTypes
|
||||
from logbook import Logger
|
||||
|
||||
@@ -892,7 +892,7 @@ class Fit(object):
|
||||
if self.ship is None:
|
||||
return
|
||||
|
||||
for slotType in (FittingSlot.LOW, FittingSlot.MED, FittingSlot.HIGH, FittingSlot.RIG, FittingSlot.SUBSYSTEM, FittingSlot.SERVICE):
|
||||
for slotType in (FittingSlot.LOW.value, FittingSlot.MED.value, FittingSlot.HIGH.value, FittingSlot.RIG.value, FittingSlot.SUBSYSTEM.value, FittingSlot.SERVICE.value):
|
||||
amount = self.getSlotsFree(slotType, True)
|
||||
if amount > 0:
|
||||
for _ in range(int(amount)):
|
||||
|
||||
@@ -23,7 +23,7 @@ from logbook import Logger
|
||||
from sqlalchemy.orm import reconstructor, validates
|
||||
|
||||
import eos.db
|
||||
from eos.const import FittingSlot, FittingModuleState, FittingHardpoint
|
||||
from eos.const import FittingModuleState, FittingHardpoint, FittingSlot
|
||||
from eos.effectHandlerHelpers import HandledCharge, HandledItem
|
||||
from eos.enum import Enum
|
||||
from eos.modifiedAttributeDict import ChargeAttrShortcut, ItemAttrShortcut, ModifiedAttributeDict
|
||||
@@ -720,12 +720,12 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
@staticmethod
|
||||
def calculateSlot(item):
|
||||
effectSlotMap = {
|
||||
"rigSlot" : FittingSlot.RIG,
|
||||
"loPower" : FittingSlot.LOW,
|
||||
"medPower" : FittingSlot.MED,
|
||||
"hiPower" : FittingSlot.HIGH,
|
||||
"subSystem" : FittingSlot.SUBSYSTEM,
|
||||
"serviceSlot": FittingSlot.SERVICE
|
||||
"rigSlot" : FittingSlot.RIG.value,
|
||||
"loPower" : FittingSlot.LOW.value,
|
||||
"medPower" : FittingSlot.MED.value,
|
||||
"hiPower" : FittingSlot.HIGH.value,
|
||||
"subSystem" : FittingSlot.SUBSYSTEM.value,
|
||||
"serviceSlot": FittingSlot.SERVICE.value
|
||||
}
|
||||
if item is None:
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user