﻿using Gamelogic.Grids;
using UnityEngine;

public class RotationMap : CustomMapBuilder 
{
   public float angle;

	public override WindowedMap<TPoint> CreateWindowedMap<TPoint>()
	{
	
		if (typeof (TPoint) != typeof (PointyHexPoint))
		{
			Debug.LogError("You can only use this MapBuilder with pointy hex grids", this);

			return null;
		}

		var cellDimensions = GetComponent<PointyHexTileGridBuilder>().CellPrefab.Dimensions;

		return (WindowedMap<TPoint>)(object)new PointyHexMap(cellDimensions)
			.Rotate(angle)
			.WithWindow(new Rect(0, 0, 0, 0));
	}
}