From 056534028da66595f6cb8993b7b42aa575c148e2 Mon Sep 17 00:00:00 2001 From: Persson-dev Date: Wed, 1 Sep 2021 15:51:40 +0200 Subject: [PATCH] fix: updated world write test --- src/game/World.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/game/World.cpp b/src/game/World.cpp index 137f5e9..48cbb48 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -125,12 +125,12 @@ bool World::loadMapFromFile(const std::string& fileName){ blueTile1.team_owner = TeamColor::Blue; m_TilePalette.push_back(std::make_shared(blueTile1)); - m_Castles[(uint) TeamColor::Red].x = 58; - m_Castles[(uint) TeamColor::Red].y = 43; + getRedTeam().getCastle().x = 58; + getRedTeam().getCastle().y = 43; - m_Spawns[(uint) TeamColor::Red].direction = Direction::PositiveY; - m_Spawns[(uint) TeamColor::Red].x = 13; - m_Spawns[(uint) TeamColor::Red].y = 13; + getRedTeam().getSpawn().x = 13; + getRedTeam().getSpawn().y = 13; + getRedTeam().getSpawn().direction = Direction::PositiveY; m_SpawnColorPalette[(uint) TeamColor::Red] = {255, 0, 0}; @@ -262,15 +262,14 @@ bool World::loadMapFromFile(const std::string& fileName){ m_Chunks.insert({{1, 1}, std::make_shared(chunk2)}); - // blue map = same but with offset of 64 + // blue map = same but with offset of 64 (in x coordinate) + getBlueTeam().getCastle().x = 58 + 64; + getBlueTeam().getCastle().y = 43; - m_Castles[(uint) TeamColor::Blue].x = 58 + 64; - m_Castles[(uint) TeamColor::Blue].y = 43; - - m_Spawns[(uint) TeamColor::Blue].direction = Direction::PositiveY; - m_Spawns[(uint) TeamColor::Blue].x = 13 + 64; - m_Spawns[(uint) TeamColor::Blue].y = 13; + getBlueTeam().getSpawn().x = 13 + 64; + getBlueTeam().getSpawn().y = 13; + getBlueTeam().getSpawn().direction = Direction::PositiveY; m_SpawnColorPalette[(uint) TeamColor::Blue] = {0, 0, 255};