I have an enum with flags setup for my grid system:
[Flags]
public enum GridNeighbours
{
North = 1,
NorthEast = 2,
East = 4,
SouthEast = 8,
South = 16,
SouthWest = 32,
West = 64,
NorthWest = 128
}
But i want to also access them by index so if i want the index of say East, i would get [2] not 4.
Casting to int doesn't do the job as that just gives the flag number which i am not looking for.
Is there a way to do that at all ?