| 684 | |
| 685 | |
| 686 | class Section: |
| 687 | |
| 688 | def __init__(self): |
| 689 | self.lines = [] |
| 690 | self.itemSpecs = [] |
| 691 | self.__itemDataCats = None |
| 692 | |
| 693 | @property |
| 694 | def itemDataCats(self): |
| 695 | if self.__itemDataCats is None: |
| 696 | cats = set() |
| 697 | for itemSpec in self.itemSpecs: |
| 698 | if itemSpec is None: |
| 699 | continue |
| 700 | cats.add(itemSpec.item.category.name) |
| 701 | self.__itemDataCats = tuple(sorted(cats)) |
| 702 | return self.__itemDataCats |
| 703 | |
| 704 | @property |
| 705 | def isModuleRack(self): |
| 706 | return all(i is None or i.isModule for i in self.itemSpecs) |
| 707 | |
| 708 | @property |
| 709 | def isImplantRack(self): |
| 710 | return all(i is not None and i.isImplant for i in self.itemSpecs) |
| 711 | |
| 712 | @property |
| 713 | def isDroneBay(self): |
| 714 | return all(i is not None and i.isDrone for i in self.itemSpecs) |
| 715 | |
| 716 | @property |
| 717 | def isFighterBay(self): |
| 718 | return all(i is not None and i.isFighter for i in self.itemSpecs) |
| 719 | |
| 720 | @property |
| 721 | def isCargoHold(self): |
| 722 | return ( |
| 723 | all(i is not None and i.isCargo for i in self.itemSpecs) and |
| 724 | not self.isDroneBay and not self.isFighterBay) |
| 725 | |
| 726 | |
| 727 | class BaseItemSpec: |
no outgoing calls
no test coverage detected