how to make a loop with a enum code example
Example 1: java loop through enum
for (Direction dir : Direction.values()) {
// do what you want
}
Example 2: loop over all values in enum
var values = Enum.GetValues(typeof(Foos)).Cast<Foos>();
for (Direction dir : Direction.values()) {
// do what you want
}
var values = Enum.GetValues(typeof(Foos)).Cast<Foos>();