diff --git a/C++ProjectTemplate b/C++ProjectTemplate index a9b096f..c50e6e5 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/SeasonI.h b/SeasonI.h index 84200ac..db8c30b 100644 --- a/SeasonI.h +++ b/SeasonI.h @@ -33,8 +33,8 @@ class SeasonI:public PixelGameEngine{ void SetupObjectInfo(); 됐어 void SetupEncounters(); 됐어 void SetupBattleProperties(); 됐어 - void SetupCutscenes(); - void SetupMapList(); + void SetupCutscenes(); 됐어 + void SetupMapList(); 됐어 void SetGameFlag(Flag flag,bool val); 됐어 void LoadMap(Map*map); void SaveMap(Map*map); diff --git a/test/test.cpp b/test/test.cpp index 41ddbf3..7119484 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -44,7 +44,12 @@ extern std::vectorENCOUNTER_LIST; extern std::map BATTLE_PROPERTIES; extern std::map MAPS; extern std::vectorCUTSCENE_QUEUE; +extern std::vector> MAP; +extern std::vector> MAP2; +extern std::vector> MAP3; +extern std::vector> MAP4; extern std::vector> MAP5; +extern std::vector> MAP6; int testCount=0; int MAX_ITERATIONS=1000; @@ -95,6 +100,30 @@ namespace key{ TestKey NP2{Key::NP2,"NP2",KeyIdentifier::DOWN}; } +void CopyMapContents(std::vector>&from,std::vector>&to) { + for (int x=0;x tiles; + for (int y=0;ytileX,from[x][y]->tileY,from[x][y]->tileDegree)); + } + to.push_back(tiles); + } +} + +bool ValidateEntireMap(std::vector>&mapref1,std::vector>&mapref2) { + for (int x=0;xtileX<<"|"<tileY<<"|"<tileDegree)<> TEMPMAP; + std::vector> TEMPMAP2; + std::vector> TEMPMAP3; + std::vector> TEMPMAP4; + std::vector> TEMPMAP5; + std::vector> TEMPMAP6; + CopyMapContents(MAP,TEMPMAP); + CopyMapContents(MAP2,TEMPMAP2); + CopyMapContents(MAP3,TEMPMAP3); + CopyMapContents(MAP4,TEMPMAP4); + CopyMapContents(MAP5,TEMPMAP5); + CopyMapContents(MAP6,TEMPMAP6); + Test("Entire map should be copied over properly for testing", + ValidateEntireMap(MAP,TEMPMAP)&& + ValidateEntireMap(MAP2,TEMPMAP2)&& + ValidateEntireMap(MAP3,TEMPMAP3)&& + ValidateEntireMap(MAP4,TEMPMAP4)&& + ValidateEntireMap(MAP5,TEMPMAP5)&& + ValidateEntireMap(MAP6,TEMPMAP6)); return true; } diff --git a/tiles.h b/tiles.h index c51a2ed..06eaf97 100644 --- a/tiles.h +++ b/tiles.h @@ -26,5 +26,13 @@ class TILE{ } return 0; } + bool operator==(const TILE* rhs) { + return tileX==rhs->tileX&& + tileY==rhs->tileY&& + tileDegree==rhs->tileDegree; + } + bool operator!=(const TILE*t) { + return !(*this==t); + } }; #endif \ No newline at end of file