mirror of
https://github.com/HowestDAE/dae16-VerhulstBram.git
synced 2025-12-16 17:51:47 +01:00
Fix digging
This commit is contained in:
@@ -18,7 +18,7 @@ enum class GroundTileTypes
|
||||
class GroundTileType
|
||||
{
|
||||
public:
|
||||
GroundTileType(const std::string& filePath, GroundTileTypes type): m_filePath(filePath), m_type(type) {
|
||||
GroundTileType(const std::string&& filePath, GroundTileTypes type): m_filePath(filePath), m_type(type) {
|
||||
}
|
||||
virtual ~GroundTileType() = default;
|
||||
bool operator==(const GroundTileType& rhs) const {
|
||||
@@ -53,7 +53,7 @@ private:
|
||||
class RandomGroundTile : public GroundTileType
|
||||
{
|
||||
public:
|
||||
RandomGroundTile(const std::string& filePath, GroundTileTypes type, int maxRandom): GroundTileType(filePath, type), m_maxRandom(maxRandom) {
|
||||
RandomGroundTile(const std::string& filePath, GroundTileTypes type, int maxRandom): GroundTileType(std::move(filePath), type), m_maxRandom(maxRandom) {
|
||||
}
|
||||
|
||||
~RandomGroundTile() override = default;
|
||||
@@ -96,6 +96,8 @@ namespace Tiles
|
||||
static GroundTileType* HARD_LEFT = new GroundTileType("tiles/dirt/special/hardLeft.png", GroundTileTypes::Hard);
|
||||
static GroundTileType* HARD_RIGHT = new GroundTileType("tiles/dirt/special/hardRight.png", GroundTileTypes::Hard);
|
||||
static GroundTileType* HARD_MIDDLE = new GroundTileType("tiles/dirt/special/hardMiddle.png", GroundTileTypes::Hard);
|
||||
|
||||
static GroundTileType* GRASS = new RandomGroundTile("tiles/dirt/special/grass[0].png", GroundTileTypes::Dirt, 2);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +127,7 @@ public:
|
||||
}
|
||||
void SetTileType(GroundTileType* type) {
|
||||
m_GroundTileType = type;
|
||||
m_pTexture = TextureManager::GetInstance()->GetTexture(type->getPath()); //Chage the texture when setting a new type
|
||||
}
|
||||
|
||||
Collision::TileCollisionRect GetCollisionRect();
|
||||
@@ -133,7 +136,6 @@ public:
|
||||
|
||||
private:
|
||||
void DrawSide(const TileDirection& direction);
|
||||
|
||||
|
||||
Vector2f m_Position;
|
||||
GroundTileType* m_GroundTileType;
|
||||
|
||||
Reference in New Issue
Block a user