mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-18 22:29:20 +01:00
Started on GuiIcon, General fixes
This commit is contained in:
@@ -14,8 +14,7 @@ static const int TILE_HEIGHT = 50;
|
||||
|
||||
class WorldTile;
|
||||
|
||||
enum TileDirection
|
||||
{
|
||||
enum TileDirection {
|
||||
TopLeft,
|
||||
TopMiddle,
|
||||
TopRight,
|
||||
@@ -29,41 +28,31 @@ enum TileDirection
|
||||
BottomRight
|
||||
};
|
||||
|
||||
struct surroundingTiles
|
||||
{
|
||||
struct surroundingTiles {
|
||||
|
||||
std::vector<WorldTile *> m_tiles{ 8, nullptr};
|
||||
std::vector<WorldTile *> m_tiles { 8, nullptr };
|
||||
|
||||
void SetTile(TileDirection direction, WorldTile* tile) {
|
||||
m_tiles[static_cast<int>(direction)] = tile;
|
||||
}
|
||||
|
||||
WorldTile* GetTile(TileDirection direction) {
|
||||
WorldTile * GetTile(TileDirection direction) {
|
||||
return m_tiles[static_cast<int>(direction)];
|
||||
}
|
||||
|
||||
// bool IsAllType(const GroundTileType& type) {
|
||||
// for (const auto& tile : m_tiles) {
|
||||
// if (tile.second == nullptr) {
|
||||
// return false;
|
||||
// }
|
||||
// if (tile.second->GetTileType() != &type) {
|
||||
// return false;
|
||||
// }
|
||||
// }
|
||||
// return true;
|
||||
// }
|
||||
};
|
||||
|
||||
class WorldGridManager
|
||||
{
|
||||
class WorldGridManager {
|
||||
public:
|
||||
WorldGridManager();
|
||||
~WorldGridManager();
|
||||
surroundingTiles GetSurroundingTiles(const WorldTile* world_tile);
|
||||
Vector2f GetIndexFromPosition(Vector2f position);
|
||||
static Vector2f GetIndexFromPosition(Vector2f position);
|
||||
|
||||
WorldGridManager(const WorldGridManager& other) = default;
|
||||
WorldGridManager(const WorldGridManager& other) = delete;
|
||||
WorldGridManager(WorldGridManager&& other) = default;
|
||||
WorldGridManager& operator=(const WorldGridManager& other) = delete;
|
||||
WorldGridManager& operator=(WorldGridManager&& other) = delete;
|
||||
|
||||
|
||||
WorldTile * GetTileAtIndex(const int x, const int y) const;
|
||||
WorldTile * GetTileAtWorldPos(const Vector2f& pos) const;
|
||||
|
||||
Reference in New Issue
Block a user