mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59: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 Game::crewrescued()
|
||||||
{
|
{
|
||||||
int temp = 0;
|
return std::count(crewstats.begin(), crewstats.end(), true);
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Game::resetgameclock()
|
void Game::resetgameclock()
|
||||||
|
|
Loading…
Reference in a new issue