mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-22 17:49:43 +01:00
Refactor Game::crewrescued() to use std::count() instead
Makes the code less hardcoded, take up less lines, and is way easier to read.
This commit is contained in:
parent
588a49dbc8
commit
699af342e8
1 changed files with 1 additions and 14 deletions
|
@ -7622,20 +7622,7 @@ void Game::swnpenalty()
|
|||
|
||||
int Game::crewrescued()
|
||||
{
|
||||
int temp = 0;
|
||||
if (crewstats[0])
|
||||
temp++;
|
||||
if (crewstats[1])
|
||||
temp++;
|
||||
if (crewstats[2])
|
||||
temp++;
|
||||
if (crewstats[3])
|
||||
temp++;
|
||||
if (crewstats[4])
|
||||
temp++;
|
||||
if (crewstats[5])
|
||||
temp++;
|
||||
return temp;
|
||||
return std::count(crewstats.begin(), crewstats.end(), true);
|
||||
}
|
||||
|
||||
void Game::resetgameclock()
|
||||
|
|
Loading…
Reference in a new issue