I have code like this:
switch (array[0], array[1], array[2])
{
case (EntityRoute.North, EntityRoute.West, EntityRoute.South):
prohibitedRoute = EntityRoute.East;
return true;
case (EntityRoute.South, EntityRoute.West, EntityRoute.North):
prohibitedRoute = EntityRoute.East;
return true;
case (EntityRoute.North, EntityRoute.East, EntityRoute.South):
prohibitedRoute = EntityRoute.West;
return true;
case (EntityRoute.South, EntityRoute.East, EntityRoute.North):
prohibitedRoute = EntityRoute.West;
return true;
case (EntityRoute.South, EntityRoute.East, EntityRoute.North):
prohibitedRoute = EntityRoute.West;
return true;
}
I want to make a system where the order of conditions is not strict. Is there any option to make this without writing additional cases? Please take into account that I'm using C# 8.0 because I'm working in Unity3D.