Initialize a fighter from the database and validate
(self)
| 77 | |
| 78 | @reconstructor |
| 79 | def init(self): |
| 80 | """Initialize a fighter from the database and validate""" |
| 81 | self.__item = None |
| 82 | |
| 83 | if self.itemID: |
| 84 | self.__item = eos.db.getItem(self.itemID) |
| 85 | if self.__item is None: |
| 86 | pyfalog.error("Item (id: {0}) does not exist", self.itemID) |
| 87 | return |
| 88 | |
| 89 | if self.isInvalid: |
| 90 | pyfalog.error("Item (id: {0}) is not a Fighter", self.itemID) |
| 91 | return |
| 92 | |
| 93 | self.build() |
| 94 | |
| 95 | def build(self): |
| 96 | """ Build object. Assumes proper and valid item already set """ |