using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace Framework.DataStructures
{
    /// <summary>
    /// The Vector3Data class is used to serialize the Vector3 class as Unity
    /// classes cannot be serialized.
    /// </summary>
    [Serializable]
    public class Vector3Data
    {
        public float x;
        public float y;
        public float z;

        /// <summary>
        /// Initializes a new instance of the <see cref="Vector3Data"/> class.
        /// Does so by taking in a Vector3 object and storing all of its 
        /// significant values.
        /// </summary>
        /// <param name="vector3">The vector3.</param>
        public Vector3Data(Vector3 vector3)
        {
            this.x = vector3.x;
            this.y = vector3.y;
            this.z = vector3.z;
        }

        /// <summary>
        /// Converts this Vector3Data object back into a Vector3 object.
        /// </summary>
        /// <returns></returns>
        public Vector3 ToVector3()
        {
            return new Vector3(this.x, this.y, this.z);
        }
    }
}
