MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / isValidState

Method isValidState

eos/saveddata/module.py:732–747  ·  view source on GitHub ↗

Check if the state is valid for this module, without considering other modules at all

(self, state)

Source from the content-addressed store, hash-verified

730 return True
731
732 def isValidState(self, state):
733 """
734 Check if the state is valid for this module, without considering other modules at all
735 """
736 # Check if we're within bounds
737 if state < -1 or state > 2:
738 return False
739 elif state >= FittingModuleState.ACTIVE and (not self.item.isType("active") or self.getModifiedItemAttr('activationBlocked') > 0):
740 return False
741 elif state == FittingModuleState.OVERHEATED and not self.item.isType("overheat"):
742 return False
743 # Some destructible effect beacons contain active effects, hardcap those at online state
744 elif state > FittingModuleState.ONLINE and self.slot == FittingSlot.SYSTEM:
745 return False
746 else:
747 return True
748
749 def getMaxState(self, proposedState=None):
750 states = sorted((s for s in FittingModuleState if proposedState is None or s <= proposedState), reverse=True)

Callers 10

importESIFunction · 0.95
importXmlFunction · 0.95
importEftCfgFunction · 0.95
__makeModuleMethod · 0.95
processImportInfoFunction · 0.95
toModuleMethod · 0.95
getMaxStateMethod · 0.95
checkStatesMethod · 0.80
importEftFunction · 0.80
getProposedStateMethod · 0.80

Calls 2

isTypeMethod · 0.45
getModifiedItemAttrMethod · 0.45

Tested by

no test coverage detected