I have the following listing:
public enum Materials { Wood, Stone, Earth, Water, Lava, Air }
Now I have 3 materials that I could walk on (wooden stone ground) and 3 that arent walkable (water lava air)
I would like to give an opportunity to compare whether the flag is one of three.
I am currently doing this:
Materials myMat = Materials.Earth; if ( myMat == Materials.Earth || myMat == Materials.Wood || myMat == Materials.Stone) { I can walk on myMat... }
It is not possible to create a new flag, for example Materials.Walkable, which will include these three materials, so I can just use
if ( myMat == Materials.Walkable )
If possible, how can I do this?
Thanks in advance;)
source share