1
0
Fork 0
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:
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 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()