I have the following enum:
public enum Materials { Wood, Stone, Earth, Water, Lava, Air }
Now I have 3materials on which i could walk (wood stone earth) and 3 which arent walkable (water lava air)
I would like to make it possible to compare if a flag is one of the three.
At the moment, this is how I do it:
Materials myMat = Materials.Earth;
if ( myMat == Materials.Earth || myMat == Materials.Wood || myMat == Materials.Stone)
{
I can walk on myMat...
}
isnt it possible to create a new flag like Materials.Walkable which would include these three materials so I can just use
if ( myMat == Materials.Walkable )
If this is possible, how can I do that?
Thanks in advance ;)