mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-18 20:29:20 +01:00
Add Text rendering and Hull / Fuel Meters
This commit is contained in:
31
Game/GridSystem/GroundTileTypeManager.cpp
Normal file
31
Game/GridSystem/GroundTileTypeManager.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "pch.h"
|
||||
#include "GroundTileTypeManager.h"
|
||||
|
||||
#include "GridSystem/WorldTile.h"
|
||||
|
||||
GroundTileTypeManager* GroundTileTypeManager::m_pInstance = nullptr;
|
||||
|
||||
GroundTileTypeManager* GroundTileTypeManager::GetInstance() {
|
||||
if (m_pInstance == nullptr) {
|
||||
m_pInstance = new GroundTileTypeManager();
|
||||
}
|
||||
return m_pInstance;
|
||||
}
|
||||
void GroundTileTypeManager::DestroyInstance() {
|
||||
delete m_pInstance->AIR;
|
||||
delete m_pInstance->DIRT;
|
||||
delete m_pInstance->STONE;
|
||||
delete m_pInstance->LAVA;
|
||||
delete m_pInstance->IRON;
|
||||
delete m_pInstance->BRONZE;
|
||||
delete m_pInstance->GOLD;
|
||||
delete m_pInstance->HARD_LEFT;
|
||||
delete m_pInstance->HARD_RIGHT;
|
||||
delete m_pInstance->HARD_MIDDLE;
|
||||
delete m_pInstance->GRASS;
|
||||
|
||||
delete m_pInstance;
|
||||
}
|
||||
GroundTileTypeManager::GroundTileTypeManager() = default;
|
||||
|
||||
GroundTileTypeManager::~GroundTileTypeManager() = default;
|
||||
56
Game/GridSystem/GroundTileTypeManager.h
Normal file
56
Game/GridSystem/GroundTileTypeManager.h
Normal file
@@ -0,0 +1,56 @@
|
||||
#pragma once
|
||||
#include <map>
|
||||
|
||||
#include "GridSystem/WorldTile.h"
|
||||
|
||||
|
||||
class GroundTileType;
|
||||
|
||||
class GroundTileTypeManager
|
||||
{
|
||||
public:
|
||||
static GroundTileTypeManager* GetInstance();
|
||||
static void DestroyInstance();
|
||||
|
||||
GroundTileType* AIR;
|
||||
GroundTileType* DIRT;
|
||||
|
||||
GroundTileType* STONE;
|
||||
GroundTileType* LAVA;
|
||||
|
||||
GroundTileType* IRON;
|
||||
GroundTileType* BRONZE;
|
||||
GroundTileType* GOLD;
|
||||
|
||||
GroundTileType* HARD_LEFT;
|
||||
GroundTileType* HARD_RIGHT;
|
||||
GroundTileType* HARD_MIDDLE;
|
||||
|
||||
GroundTileType* GRASS;
|
||||
|
||||
|
||||
//
|
||||
// static GroundTileType* AIR{ nullptr };
|
||||
//
|
||||
//
|
||||
// static std::map<GroundTileType *, float> GroundTileWeights {
|
||||
// { Tiles::AIR, 0.2f },
|
||||
// { Tiles::DIRT, 0.5f },
|
||||
// { Tiles::Special::GRASS, 0.0f },
|
||||
// { Tiles::Hazards::STONE, 0.025f },
|
||||
// { Tiles::Hazards::LAVA, 0.01f },
|
||||
// { Tiles::Special::HARD_LEFT, 0.0f },
|
||||
// { Tiles::Special::HARD_MIDDLE, 0.0f },
|
||||
// { Tiles::Special::HARD_RIGHT, 0.0f },
|
||||
// { Tiles::Ores::BRONZE, 0.05f },
|
||||
// { Tiles::Ores::GOLD, 0.02f },
|
||||
// { Tiles::Ores::IRON, 0.1f },
|
||||
// };
|
||||
|
||||
private:
|
||||
GroundTileTypeManager();
|
||||
~GroundTileTypeManager();
|
||||
|
||||
static GroundTileTypeManager* m_pInstance;
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user