﻿using Gamelogic.Grids;
using UnityEngine;

public class RingGridBuilder : CustomGridBuilder
{
	public int size;

	public override IGrid<TCell, TPoint> MakeGrid<TCell, TPoint>()
	{
		if (typeof(TPoint) != typeof(PointyHexPoint))
		{
			Debug.LogError("You can only use this GridBuilder with pointy hex grids", this);
		}

		return (IGrid<TCell, TPoint>)PointyHexGrid<TCell>
		   .BeginShape()
			  .Hexagon(size)
			  .Translate(size - 2, size - 2)
			  .Difference()
			  .Hexagon(size - 1)
		   .EndShape();
	}
}