using System;

namespace Icarus.Logic.Physics
{
    
	/// <summary>
	/// I contain the points used in Physics Calculations
	/// 
	/// Don't mess with me.
	/// </summary>
    public class Point 
    {

        #region Contruction

        public Point()
        {
            
        }

        public Point(float fX, float fY, float fZ)
        {
            this.x = fX;
            this.y = fY;
            this.z = fZ;
        }

        #endregion

		#region Declarations

		private float xval;
		private float yval;
		private float zval;

		#endregion

		#region Fields

		/// <summary>
		/// X value
		/// </summary>
		public float x 
		{
			get { return xval; }
			set { xval = value;}
		}

		/// <summary>
		/// Y value
		/// </summary>
		public float y 
		{
			get { return yval; } 
			set { yval = value;}
		}

		/// <summary>
		/// Z value
		/// </summary>
		public float z 
		{
			get { return zval; }
			set { zval = value;}
		}   

		#endregion

		#region Methods

		/// <summary>
		/// Output information about the Point
		/// </summary>
		public void PrintPoint() 
		{   
			Console.WriteLine(this.ToString());
		}

		/// <summary>
		/// Returns a new point that is the sum of this point and the one passed in.
		/// </summary>
		/// <param name="otherPoint"></param>
		/// <returns></returns>
		public Point Add(Point otherPoint)
		{
			return new Point(
				this.x + otherPoint.x,
				this.y + otherPoint.y,
				this.z + otherPoint.z);
		}

		/// <summary>
		/// Returns a string version of the point containing all values
		/// of the Point (x,y,z) in text form
		/// </summary>
		/// <returns>A string containing the representation</returns>
		public override string ToString() 
		{
			return ("Point:\n" +
				"  x = " + this.x +
				"  y = " + this.y +
				"  z = " + this.z);      
		}

		#endregion
            
	}
}