1
0
Fork 0
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:
Misa 2020-04-08 22:31:15 -07:00 committed by Ethan Lee
parent 588a49dbc8
commit 699af342e8

View file

@ -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()