public int ExitInDirection(int direction) { // If the direction exceeds the bounds of the exits array, return -1 if (direction >= _numberOfDirections || direction < 0) return -1; // Return the id of the location stored in the exits array in the specified direction return _exits[direction]; }