﻿using System;
using UnityEngine;

namespace Gamelogic.Grids.Examples
{
	public class HillsPointyHexMapBuilder : CustomMap3DBuilder
	{
		public float amplitude;
		public Vector2 frequency;
		

		public override IMap3D<TPoint> CreateMap<TPoint>()
		{
			return (IMap3D<TPoint>) CreateMeshMap<TPoint>();
		}

		public override IMeshMap<TPoint> CreateMeshMap<TPoint>()
		{
			if (typeof(TPoint) != typeof(PointyHexPoint))
			{
				throw new Exception("This CustomeMap3DBuilder must be used with Pointy Hex Grids");
			}

			var gridBuilder = GetComponent<PointyHexMeshGridBuilder>();

			return (IMeshMap<TPoint>)new HillsPointyHexMap(gridBuilder.cellDimensions, amplitude, frequency);
		}
	}


}