notifyListeners method
void
notifyListeners()
Implementation
void notifyListeners() {
if (!hasGameRef) return;
bool notifyChangeEnemy = false;
int countLive = livingEnemies?.length ?? 0;
if (_lastCountLiveEnemies != countLive) {
_lastCountLiveEnemies = countLive;
notifyChangeEnemy = true;
}
if (_gameListeners.isNotEmpty) {
for (var element in _gameListeners) {
element.updateGame();
if (notifyChangeEnemy) {
element.changeCountLiveEnemies(_lastCountLiveEnemies);
}
}
}
}