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)
| 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 |
no test coverage detected