| 73 | |
| 74 | @classmethod |
| 75 | def fromModule(cls, mod, unmutate=False): |
| 76 | if mod is None: |
| 77 | return None |
| 78 | if unmutate and mod.isMutated: |
| 79 | info = cls( |
| 80 | itemID=mod.baseItemID, |
| 81 | baseItemID=None, |
| 82 | mutaplasmidID=None, |
| 83 | mutations={}, |
| 84 | chargeID=mod.chargeID, |
| 85 | state=mod.state, |
| 86 | spoolType=mod.spoolType, |
| 87 | spoolAmount=mod.spoolAmount, |
| 88 | rahPattern=mod.rahPatternOverride) |
| 89 | else: |
| 90 | info = cls( |
| 91 | itemID=mod.itemID, |
| 92 | baseItemID=mod.baseItemID, |
| 93 | mutaplasmidID=mod.mutaplasmidID, |
| 94 | mutations={m.attrID: m.value for m in mod.mutators.values()}, |
| 95 | chargeID=mod.chargeID, |
| 96 | state=mod.state, |
| 97 | spoolType=mod.spoolType, |
| 98 | spoolAmount=mod.spoolAmount, |
| 99 | rahPattern=mod.rahPatternOverride) |
| 100 | return info |
| 101 | |
| 102 | def toModule(self, fallbackState=None): |
| 103 | mkt = Market.getInstance() |