using System; using System.Diagnostics; using LavishScriptAPI; using MRBot.IsxEq2.Helpers; namespace MRBot.IsxEq2.Utility { /// /// This DataType provides control over and information about Saved EQ2 Locations. /// public class EQ2Location : LavishScriptObject { #region Constructor /// /// Constructor /// /// LS Object public EQ2Location(LavishScriptObject copy) : base(copy) { } #endregion #region Members /// /// Cache of Label /// private string _label; /// /// The label appended to the location /// public string Label { get { Trace.WriteLine(String.Format("EQ2Location:Label")); return _label ?? (_label = this.GetStringFromLSO("Label")); } } /// /// Cache of Notes /// private string _notes; /// /// Notes associated with this location /// public string Notes { get { Trace.WriteLine(String.Format("EQ2Location:Notes")); return _notes ?? (_notes = this.GetStringFromLSO("Notes")); } } /// /// Cache of X /// private float? _x; /// /// x-coordinate /// public float X { get { Trace.WriteLine(String.Format("EQ2Location:X")); if(!_x.HasValue) _x = this.GetFloatFromLSO("X"); return _x.Value; } } /// /// Cache of Y /// private float? _y; /// /// y-coordinate /// public float Y { get { Trace.WriteLine(String.Format("EQ2Location:Y")); if(!_y.HasValue) _y = this.GetFloatFromLSO("Y"); return _y.Value; } } /// /// Cache of Z /// private float? _z; /// /// z-coordinate /// public float Z { get { Trace.WriteLine(String.Format("EQ2Location:Z")); if(!_z.HasValue) _z = this.GetFloatFromLSO("Z"); return _z.Value; } } /// /// Cache of Zone /// private string _zone; /// /// The zone of the eq2location /// public string Zone { get { Trace.WriteLine(String.Format("EQ2Location:Zone")); return _zone ?? (_zone = this.GetStringFromLSO("Zone")); } } #endregion #region Methods /// /// Deletes the eq2location /// /// call success public bool Delete() { Trace.WriteLine(String.Format("EQ2Location:Delete")); return this.ExecuteMethod("Delete"); } /// /// Rotates the character towards the eq2location /// /// call success public bool Face() { Trace.WriteLine(String.Format("EQ2Location:Face")); return this.ExecuteMethod("Face"); } /// /// Creates an ingame waypoint to the eq2location /// /// call success public bool WaypointTo() { Trace.WriteLine(String.Format("EQ2Location:WaypointTo")); return this.ExecuteMethod("WaypointTo"); } #endregion } }