removed last TODO

This commit is contained in:
Thomas 2022-01-10 09:40:47 +01:00
parent b7632df576
commit 9dc5a03427
No known key found for this signature in database
GPG Key ID: E538821A6CDFDAD7
3 changed files with 9 additions and 10 deletions

View File

@ -221,10 +221,10 @@ private:
bool invadersTouchPlayer() const; bool invadersTouchPlayer() const;
/*! /*!
* @brief change god's state to awake * @brief Try to awake god, if not already awaken
* @fn void awakeGod(); * @fn void tryAwakeGod();
*/ */
void awakeGod(); void tryAwakeGod();
/*! /*!
* @brief make god behave * @brief make god behave

View File

@ -108,10 +108,7 @@ WinValue Game::enterGameLoop(){ // returns when game is finished
managePlayers(); managePlayers();
if(manageInvaders()) { // if they went down if(manageInvaders()) { // if they went down
if (invadersTouchPlayer())return WinValue::INVADERS; if (invadersTouchPlayer())return WinValue::INVADERS;
// TODO abstract this ? tryAwakeGod();
if (basePos.getY() > 100 /*lambda value*/ && god.state==GodState::NONE) {
awakeGod();
}
} }
if(manageGod())return WinValue::PLAYERS; if(manageGod())return WinValue::PLAYERS;

View File

@ -10,9 +10,11 @@
#include "game.h" #include "game.h"
void Game::awakeGod() { void Game::tryAwakeGod() {
god.counter = 0; if (basePos.getY() > 100 /*lambda value*/ && god.state==GodState::NONE) {
god.state = GodState::AWAKE; god.counter = 0;
god.state = GodState::AWAKE;
}
} }
/** /**