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

Method fits

eos/saveddata/module.py:661–681  ·  view source on GitHub ↗

Function that determines if a module can be fit to the ship. We always apply slot restrictions no matter what (too many assumptions made on this), however all other fitting restrictions are optional

(self, fit, hardpointLimit=True)

Source from the content-addressed store, hash-verified

659 self.__reloadForce = type
660
661 def fits(self, fit, hardpointLimit=True):
662 """
663 Function that determines if a module can be fit to the ship. We always apply slot restrictions no matter what
664 (too many assumptions made on this), however all other fitting restrictions are optional
665 """
666
667 slot = self.slot
668 if slot is None:
669 return False
670 if fit.getSlotsFree(slot) <= (0 if self.owner != fit else -1):
671 return False
672
673 fits = self.__fitRestrictions(fit, hardpointLimit)
674
675 if not fits and fit.ignoreRestrictions:
676 self.restrictionOverridden = True
677 fits = True
678 elif fits and fit.ignoreRestrictions:
679 self.restrictionOverridden = False
680
681 return fits
682
683 def __fitRestrictions(self, fit, hardpointLimit=True):
684

Callers 4

importESIFunction · 0.95
importXmlFunction · 0.95
importEftCfgFunction · 0.95
processImportInfoFunction · 0.95

Calls 2

__fitRestrictionsMethod · 0.95
getSlotsFreeMethod · 0.80

Tested by

no test coverage detected