* Changes the current AI state. * @param aiState Pointer to AI state. */
| 1580 | * @param aiState Pointer to AI state. |
| 1581 | */ |
| 1582 | void BattleUnit::setAIState(BattleAIState *aiState) |
| 1583 | { |
| 1584 | if (_currentAIState) |
| 1585 | { |
| 1586 | _currentAIState->exit(); |
| 1587 | delete _currentAIState; |
| 1588 | } |
| 1589 | _currentAIState = aiState; |
| 1590 | _currentAIState->enter(); |
| 1591 | } |
| 1592 | |
| 1593 | /** |
| 1594 | * Returns the current AI state. |
no test coverage detected