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;
/*!
* @brief change god's state to awake
* @fn void awakeGod();
* @brief Try to awake god, if not already awaken
* @fn void tryAwakeGod();
*/
void awakeGod();
void tryAwakeGod();
/*!
* @brief make god behave

View File

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

View File

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