Add more digging logic

This commit is contained in:
Bram Verhulst
2024-03-20 17:10:36 +01:00
parent a165c0bc6f
commit ad847355b5
9 changed files with 134 additions and 46 deletions

30
Game/WorldGridManager.h Normal file
View File

@@ -0,0 +1,30 @@
#pragma once
#include <array>
#include "structs.h"
static const int WORLD_WIDTH = 34;
static const int WORLD_HEIGHT = 34;
static const int TILE_WIDTH = 50;
static const int TILE_HEIGHT = 50;
class WorldTile;
class WorldGridManager
{
public:
WorldGridManager();
~WorldGridManager();
WorldTile* GetTileAtIndex(const int x, const int y) const;
WorldTile* GetTileAtWorldPos(const Point2f& pos) const;
void SetTileAtIndex(const int x, const int y, WorldTile* tile);
private:
std::array<std::array<WorldTile*, WORLD_WIDTH>, WORLD_HEIGHT> m_worldTiles;
};