Skip to content

Commit

Permalink
get map tile and set
Browse files Browse the repository at this point in the history
  • Loading branch information
jonylu7 committed Mar 10, 2024
1 parent d676733 commit e5c808f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions include/Map.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ class MapClass : public Core::Drawable {
return m_Map[position.x][position.y];
}

void setTileByCellPosition(glm::vec2 position,
std::shared_ptr<TileClass> tile) {
if (position.x > m_MapWdith - 1 || position.y > m_MapHeight - 1 ||
position.x < 0 || position.y < 0) {
LOG_DEBUG("False Position Getting");
return;
}
m_Map[position.x][position.y] = tile;
}

// weird
static std::vector<std::shared_ptr<TileClass>>
readMapAndTileSet(std::vector<int> map, std::map<int, TileClass> tileset) {
Expand Down

0 comments on commit e5c808f

Please sign in to comment.