Hello.
The title is of, i am aware but i dont know how to describe the issue.
Intro:
I am making a 2d tiled map. Each tile has type that is a enum type.
class Tile{public: int type;}
The want to do:
I want to make a enum defined like this to be able to have state?
When i check collision, i want to check player V.S. the tile he is gonna move to, if the tile he wants to move to is "unwalkable" deny the movement, else relocate.
enum Tile_Type
{
grass = 1,
water = 2,
stone = 3
};
bool CollisionChecking()
{
if(VectorOfTiles[playerPositionInMap].TypeID] == my_enums::UNWALKABLE)
{ // Deny movement
}
else
{ // Relocate
}
}
The issue is that i want to set types for enum "Tile_Type" something like this
grass = WALKABLE;
water = UNWALKABLE;
stone = UNWALKABLE;
Any ideas how to achieve something similar to this?