//--------------------------------------
//               PowerUI
//
//        For documentation or 
//    if you have any issues, visit
//        powerUI.kulestar.com
//
//    Copyright  2013 Kulestar Ltd
//          www.kulestar.com
//--------------------------------------

using System;
using UnityEngine;


namespace Css.Units{
	
	/// <summary>
	/// Represents an instance of a turn angle.
	/// </summary>
	
	public class TurnUnit:AngleUnit{
		
		public override float DisplayNumber{
			get{
				return (RawValue / (2f * Mathf.PI));
			}
		}
		
		public override string ToString(){
			return DisplayNumber+"turn";
		}
		
		public override void OnValueReady(CssLexer lexer){
			// Map to radians:
			RawValue *= 2f * Mathf.PI;
		}
		
		protected override Value Clone(){
			TurnUnit result=new TurnUnit();
			result.RawValue=RawValue;
			return result;
		}
		
		public override string[] PostText{
			get{
				return new string[]{"turn"};
			}
		}
		
	}
	
}



