1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-28 23:48:30 +02: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()