Ajout de RetrieveChunk
This commit is contained in:
@@ -79,3 +79,21 @@ void World::TransposeWorld(Player& player) {
|
||||
player.Transpose(x, y);
|
||||
}
|
||||
|
||||
void World::CleanUpWorld(int& frames) {
|
||||
if (!m_tbDeleted.empty() && !frames) {
|
||||
m_tbDeleted.pop_back();
|
||||
frames = FRAMES_DELETE_CHUNKS;
|
||||
}
|
||||
}
|
||||
|
||||
Chunk* World::RetrieveChunk(int x, int y) {
|
||||
for (int index = 0; index < m_tbDeleted.size(); ++index) {
|
||||
int cx, cy;
|
||||
m_tbDeleted.at(index)->GetPosition(cx, cy);
|
||||
|
||||
if (cx == x && cy == y)
|
||||
return std::move(m_tbDeleted.at(index));
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
Reference in New Issue
Block a user