using System; using Holo.Managers; using Holo.Source.Virtual.Catalogue; 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. /// /// 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] public floorItem(int ID, int tID, int X, int Y, int Z, double H, string Var) { this.ID = ID; this.templateID = tID; this.X = X; this.Y = Y; this.Z = Convert.ToByte(Z); this.H = H; this.Var = Var; } /// /// Returns the sprite name of this item by accessing itemTemplate with the template ID. /// internal string Sprite { get { return catalogueManager.getItem(templateID).Sprite; } } /// /// Returns the item string of this item. /// public override string ToString() { itemTemplate Template = catalogueManager.getItem(templateID); if (Template.Sprite == "song_disk") return ID.ToString() + Convert.ToChar(2) + Template.Sprite + Convert.ToChar(2) + Encoding.encodeVL64(X) + Encoding.encodeVL64(Y) + Encoding.encodeVL64(Template.Length) + Encoding.encodeVL64(Template.Width) + Encoding.encodeVL64(Z) + H.ToString().Replace(",", ".") + Convert.ToChar(2) + Template.Colour + Convert.ToChar(2) + Convert.ToChar(2) + Var + Convert.ToChar(2); else return ID.ToString() + Convert.ToChar(2) + Template.Sprite + Convert.ToChar(2) + Encoding.encodeVL64(X) + Encoding.encodeVL64(Y) + Encoding.encodeVL64(Template.Length) + Encoding.encodeVL64(Template.Width) + Encoding.encodeVL64(Z) + H.ToString().Replace(",", ".") + Convert.ToChar(2) + Template.Colour + Convert.ToChar(2) + Convert.ToChar(2) + "H" + Var + Convert.ToChar(2); } } }