using System; using Holo.Virtual.Users; using Holo.Managers; using Ion.Storage; using System.Collections; namespace Holo.Virtual.Rooms.Items { /// /// Represents a virtual wallitem in a virtual room. /// public class wallItem { /// /// The ID of the item. /// internal int ID; /// /// The template ID of the item. /// internal int templateID; /// /// The position of the item on the wall of the virtual room. /// internal string wallPosition; /// /// Optional. The variable/status of the item. /// internal string Var; private static Hashtable _Users = new Hashtable(); /// /// Initializes a new instance of a virtual wallitem in a virtual room. /// /// The ID of this item. /// The template ID of this item. /// The wallposition of this item. [!Rabbit format] /// The variable of this item. [optional, if not supplied then sprite color will be set] public wallItem(int ID, int tID, string wallPosition, string Var) { this.ID = ID; this.templateID = tID; this.wallPosition = wallPosition; if (Var == "") this.Var = catalogueManager.getTemplate(tID).Colour; else this.Var = Var; } /// /// 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. /// /// /// Returns the item string of this item. /// public override string ToString() { /*int randomID = 0; foreach (virtualRoomUser roomUser in _Users.Values) { randomID = roomUser.userID; break; } virtualUser User = userManager.getUser(randomID); Rooms.Items.wallItem Item = User.Room.wallItemManager.getItem(ID); catalogueManager.itemTemplate Template = catalogueManager.getTemplate(Item.templateID); return ID + "" + Encoding.encodeVL64(Template.indexID) + wallPosition + Convert.ToChar(2) + Var; */ return ID + "" + Convert.ToChar(2) + Encoding.encodeVL64(templateID) + wallPosition + Convert.ToChar(2) + Var; } } }