2023-12-08 15:20:12 -06:00

83 lines
1.9 KiB
C#

using System;
using System.Diagnostics;
using LavishScriptAPI;
using MRBot.IsxEq2.Helpers;
namespace MRBot.IsxEq2.InventoryConsignment
{
/// <summary>
/// This DataType includes all of the data available to ISXEQ2 that is related to modifiers on items.
/// </summary>
public class ItemModifier : LavishScriptObject
{
#region Constructor
/// <summary>
/// Constructor
/// </summary>
/// <param name="copy">LS Object</param>
public ItemModifier(LavishScriptObject copy) : base(copy) { }
#endregion
#region Members
/// <summary>
/// Cache of SubType
/// </summary>
private string _subType;
/// <summary>
/// Modifier SubType
/// </summary>
public string SubType
{
get
{
Trace.WriteLine(String.Format("ItemModifier:SubType"));
return _subType ?? (_subType = this.GetStringFromLSO("SubType"));
}
}
/// <summary>
/// Cache of Type
/// </summary>
private string _type;
/// <summary>
/// Modifier Type
/// </summary>
public string Type
{
get
{
Trace.WriteLine(String.Format("ItemModifier:Type"));
return _type ?? (_type = this.GetStringFromLSO("Type"));
}
}
/// <summary>
/// Cache of Value
/// </summary>
private int? _value;
/// <summary>
/// Modifier Value
/// </summary>
public int Value
{
get
{
Trace.WriteLine(String.Format("ItemModifier:Value"));
if(!_value.HasValue)
_value = this.GetIntFromLSO("Value");
return _value.Value;
}
}
#endregion
}
}