def _moved(self, move): self._must_recharge = False self._preparing = False id_ = Move.retrieve_id(move) if Move.should_be_stored(id_): if id_ not in self._moves: self._moves[id_] = Move(id_) self.moves[id_].use()
def _add_move(self, move_id: str, use: bool = False) -> None: """Store the move if applicable.""" id_ = Move.retrieve_id(move_id) if Move.should_be_stored(id_): move = Move(id_) if move.id not in self._moves: if len(self._moves) >= 4: self._moves = {} self._moves[id_] = Move(id_) if use: self.moves[id_].use()
def _add_move(self, move_id: str, use: bool = False) -> None: """Store the move if applicable.""" id_ = Move.retrieve_id(move_id) if not Move.should_be_stored(id_): return if id_ not in self._moves: move = Move(move_id=id_) self._moves[id_] = move if use: self._moves[id_].use()
def test_should_be_stored(): assert Move.should_be_stored("flamethrower") assert not Move.should_be_stored("aciddownpour") assert not Move.should_be_stored("maxooze")