﻿using UnityEngine;

namespace Gamelogic.Grids.Examples
{
	public class Coin : GLMonoBehaviour
	{
		private const float RotateSpeed = 270;

		public FlatHexPoint CurrentLocation { get; set; }

		public void OnTriggerEnter(Collider other)
		{
			SPOD.CoinCollectedAt(CurrentLocation);
			Destroy(gameObject);
		}

		public void Update()
		{
			transform.RotateAroundY(RotateSpeed*Time.deltaTime);
		}
	}
}