using System;
using UnityEngine;

namespace mgaia.Utils
{
	/// <summary>
	/// Extensões da tupla TimeAndScale
	/// </summary>
	/// <owner>Victor</owner>
	public static class TimeAndScaleExtensions
	{
		/// <summary>
		/// Retorna todos os tempos
		/// </summary>
		public static float[] GetTimes(this TimeAndScale[] timeAndScales)
		{
			return timeAndScales.Select(timeAndScale => timeAndScale.Time).ToArray();
		}

		/// <summary>
		/// Retorna todas as escalas
		/// </summary>
		public static ValueType[] GetScales(this TimeAndScale[] timeAndScales)
		{
			return timeAndScales.Select(timeAndScale => (ValueType)timeAndScale.Scale).ToArray();
		}

		/// <summary>
		/// Retorna a primeira escala
		/// </summary>
		public static Vector3 GetFirstScale(this TimeAndScale[] timeAndScales)
		{
			return timeAndScales[0].Scale;
		}
	}
}