using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public struct MazeDimensions
{
	public int width;
	public int height;

	public MazeDimensions(int newWidth, int newHeight)
	{
		width = newWidth;
		height = newHeight;
	}

	public MazeCoordinates GetRandomRoom()
	{
		return new MazeCoordinates(
			Random.Range(0, width), Random.Range(0, height));
	}

	public MazeCoordinates GetRandomBorderRoom(MazeWallEnum wall)
	{
		MazeCoordinates RandomRoom = GetRandomRoom();

		switch (wall)
		{
			default:
			case MazeWallEnum.north:
				return new MazeCoordinates(RandomRoom.x, height - 1);
			case MazeWallEnum.south:
				return new MazeCoordinates(RandomRoom.x, 0);
			case MazeWallEnum.east:
				return new MazeCoordinates(0, RandomRoom.y);
			case MazeWallEnum.west:
				return new MazeCoordinates(width - 1, RandomRoom.y);
		}
	}

	public MazeCoordinates GetBorderRoom(MazeWallEnum wall, int index)
	{
		switch (wall)
		{
			default:
			case MazeWallEnum.north:
				return new MazeCoordinates(index, height - 1);
			case MazeWallEnum.south:
				return new MazeCoordinates(index, 0);
			case MazeWallEnum.east:
				return new MazeCoordinates(0, index);
			case MazeWallEnum.west:
				return new MazeCoordinates(width - 1, index);
		}
	}
}
