Don't use separate variable for number of trinkets in level

Same principle as removing the separate variable to track number of
collected trinkets. This means it's less error-prone as we're no longer
tracking number of trinkets separately.

In the function that counts the number of trinkets, I would've liked to
have used std::count_if(). However, the most optimal way would require
using a lambda, and lambdas are too new for the C++ standard we're
using. So I just bit the bullet and counted them manually.
This commit is contained in:
Misa
2020-04-08 22:09:11 -07:00
committed by Ethan Lee
parent 5661f46a52
commit 0047dc8d81
5 changed files with 21 additions and 13 deletions

View File

@@ -151,7 +151,7 @@ class editorclass{
std::vector <int> swapmap;
std::vector <int> contents;
std::vector <int> vmult;
int numtrinkets;
int numtrinkets();
int numcrewmates;
edlevelclass level[400]; //Maxwidth*maxheight
int kludgewarpdir[400]; //Also maxwidth*maxheight