using System;
using System.Diagnostics;
using LavishScriptAPI;
using MRBot.IsxEq2.Helpers;
namespace MRBot.IsxEq2.InventoryConsignment
{
///
/// Although this datatype is used natively in some parts of EQ2, its primary function is to
/// store and return item "details". The client does not need to know these details all of the time,
/// so when the player examines an item, or when ISXEQ2 requests it, the details are downloaded from
/// the server and stored in a cache.
///
public class ItemInfo : LavishScriptObject
{
#region Constructor
///
/// Constructor
///
/// LS Object
public ItemInfo(LavishScriptObject copy) : base(copy) { }
#endregion
#region Members
///
/// Returns TRUE if the item can be scribed right now.
/// It is the responsibility of scripts to check item.IsScribeable
///
public bool CanScribeNow
{
get
{
Trace.WriteLine(String.Format("Item:CanScribeNow"));
return this.GetBoolFromLSO("CanScribeNow");
}
}
///
/// Containers Only. Returns TRUE if the contents of the container are for sale.
/// It is the responsibility of scripts to check item.IsContainer.
///
public bool ContentsForSale
{
get
{
Trace.WriteLine(String.Format("Item:ContentsForSale"));
return this.GetBoolFromLSO("ContentsForSale");
}
}
///
/// Containers only. The number of empty slots in the container.
/// It is the responsibility of scripts to check item.IsContainer.
///
public int EmptySlots
{
get
{
Trace.WriteLine(String.Format("Item:EmptySlots"));
return this.GetIntFromLSO("EmptySlots");
}
}
///
/// Cache of Label
///
private string _label;
///
/// Item Label (Container).
/// It is the responsibility of scripts to check item.IsContainer.
///
public string Label
{
get
{
Trace.WriteLine(String.Format("Item:Label"));
return _label ?? (_label = this.GetStringFromLSO("Label"));
}
}
///
/// Cache of IsActivatable
///
private bool? _isActivatable;
///
/// Returns TRUE if the item is activatable.
/// It is the responsibility of scripts to check item.IsUsable
///
public bool IsActivatable
{
get
{
Trace.WriteLine(String.Format("Item:IsActivatable"));
if (!_isActivatable.HasValue)
_isActivatable = this.GetBoolFromLSO("IsActivatable");
return _isActivatable.Value;
}
}
#endregion
}
}