using System;
using Ion.Storage;
using Holo.Managers;
namespace Holo.Virtual.Rooms.Items
{
///
/// Represents a virtual flooritem in a virtual room.
///
public class floorItem
{
///
/// The ID of the item.
///
internal int ID;
///
/// The template ID of the item.
///
internal int templateID;
///
/// The X position of the item in the virtual room.
///
internal int X;
///
/// The Y position of the item in the virtual room.
///
internal int Y;
///
/// The rotation of the item in the virtual room.
///
internal byte Z;
///
/// The height of the item in the virtual room.
///
internal double H;
///
/// Optional. The variable/status of the item.
///
internal string Var;
///
/// Initializes a new instance of a virtual floor item in a virtual room.
///
internal int remoteID;
///
/// Initializes a new instance of a virtual floor item in a virtual room.
///
/// The ID of this item.
/// The template ID of this item.
/// The X position of this item.
/// The Y position of this item.
/// The Z rotation of this item.
/// The height on which this item is located.
/// The variable of this item. [optional]
/// The remoteID of this item. [optional]
public floorItem(int ID, int tID, int X, int Y, int Z, double H, string Var, int remoteID)
{
this.ID = ID;
this.templateID = tID;
this.X = X;
this.Y = Y;
this.Z = Convert.ToByte(Z);
this.H = H;
this.Var = Var;
this.remoteID = remoteID;
}
///
/// Returns the sprite name of this item by accessing catalogueManager.itemTemplate with the template ID.
///
internal string Sprite
{
get
{
return catalogueManager.getTemplate(templateID).Sprite;
}
}
///
/// Returns the item string of this item.
///
public override string ToString()
{
catalogueManager.itemTemplate Template = catalogueManager.getTemplate(templateID);
if (Template.Sprite == "song_disk")
return Encoding.encodeVL64(int.Parse(ID.ToString())) + Encoding.encodeVL64(Template.indexID) + Encoding.encodeVL64(X) + Encoding.encodeVL64(Y) + Encoding.encodeVL64(Z) + H.ToString().Replace(",", ".") + Convert.ToChar(2) + Var + Convert.ToChar(2) + "M";
else
return Encoding.encodeVL64(int.Parse(ID.ToString())) + Encoding.encodeVL64(Template.indexID) + Encoding.encodeVL64(X) + Encoding.encodeVL64(Y) + Encoding.encodeVL64(Z) + H.ToString().Replace(",", ".") + Convert.ToChar(2) + Encoding.encodeVL64(remoteID) + Var + Convert.ToChar(2) + "M";
}
}
}