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

Method getShipSize

service/port/efs.py:630–658  ·  view source on GitHub ↗
(groupID)

Source from the content-addressed store, hash-verified

628
629 @staticmethod
630 def getShipSize(groupID):
631 # Size groupings are somewhat arbitrary but allow for a more manageable number of top level groupings in a tree structure.
632 frigateGroupNames = ["Frigate", "Shuttle", "Corvette", "Assault Frigate", "Covert Ops", "Interceptor",
633 "Stealth Bomber", "Electronic Attack Ship", "Expedition Frigate", "Logistics Frigate"]
634 destroyerGroupNames = ["Destroyer", "Interdictor", "Tactical Destroyer", "Command Destroyer"]
635 cruiserGroupNames = ["Cruiser", "Heavy Assault Cruiser", "Logistics", "Force Recon Ship",
636 "Heavy Interdiction Cruiser", "Combat Recon Ship", "Strategic Cruiser"]
637 bcGroupNames = ["Combat Battlecruiser", "Command Ship", "Attack Battlecruiser"]
638 bsGroupNames = ["Battleship", "Elite Battleship", "Black Ops", "Marauder"]
639 capitalGroupNames = ["Titan", "Dreadnought", "Freighter", "Carrier", "Supercarrier",
640 "Capital Industrial Ship", "Jump Freighter", "Force Auxiliary"]
641 indyGroupNames = ["Hauler", "Deep Space Transport", "Blockade Runner",
642 "Mining Barge", "Exhumer", "Industrial Command Ship"]
643 miscGroupNames = ["Capsule", "Prototype Exploration Ship"]
644 shipSizes = [
645 {"name": "Frigate", "groupIDs": map(lambda s: getGroup(s).ID, frigateGroupNames)},
646 {"name": "Destroyer", "groupIDs": map(lambda s: getGroup(s).ID, destroyerGroupNames)},
647 {"name": "Cruiser", "groupIDs": map(lambda s: getGroup(s).ID, cruiserGroupNames)},
648 {"name": "Battlecruiser", "groupIDs": map(lambda s: getGroup(s).ID, bcGroupNames)},
649 {"name": "Battleship", "groupIDs": map(lambda s: getGroup(s).ID, bsGroupNames)},
650 {"name": "Capital", "groupIDs": map(lambda s: getGroup(s).ID, capitalGroupNames)},
651 {"name": "Industrial", "groupIDs": map(lambda s: getGroup(s).ID, indyGroupNames)},
652 {"name": "Misc", "groupIDs": map(lambda s: getGroup(s).ID, miscGroupNames)}
653 ]
654 for size in shipSizes:
655 if groupID in size["groupIDs"]:
656 return size["name"]
657 sizeNotFoundMsg = "ShipSize not found for groupID: " + str(groupID)
658 return sizeNotFoundMsg
659
660 @staticmethod
661 def exportEfs(fit, typeNotFitFlag, callback):

Callers 1

exportEfsMethod · 0.80

Calls 1

getGroupFunction · 0.90

Tested by

no test coverage detected