using System.Collections;
using System.Collections.Generic;
namespace Holo.Managers.catalogue
{
public struct itemTemplate
{
///
/// The type ID of the item, eg, 0 = walliten, 1 = flooritem, 2 = seat etc.
///
internal byte typeID;
///
/// The sprite of the item.
///
internal string Sprite;
///
/// The colour of the item.
///
internal string Colour;
///
/// The length of the item.
///
internal int Length;
///
/// The width of the item.
///
internal int Width;
///
/// The topheight of the item, if seat, then this indicates the sitheight. If a solid stackable item, then this is the stackheight. If 0.0, then the item is classified as non-stackable.
///
internal double topH;
///
/// Specifies if the item can be used as door.
///
internal bool isDoor;
///
/// Specifies if the item can be traded between virtual users.
///
internal bool isTradeable;
///
/// Specifies if the item can be recycled in the item recycler.
///
internal bool isRecycleable;
///
/// The TID of this item
///
internal int templateID;
///
/// The cost of this item
///
internal int cost;
///
/// Indicator if this item costs belcredits or not
///
internal bool costsBelCredits;
///
/// Inidicates if it is a pet or not
///
internal bool isPet;
internal bool isPetFood;
internal bool isPetDrink;
internal bool isPetToy;
internal bool isMoodLight;
internal byte numberOfUses;
internal bool isMusicDisk;
internal int musicDiskNumber;
internal bool isSoundMachine;
///
/// 0 = all pets
/// 1 = dog
/// 2 = cat
/// 3 = croko
///
internal byte petFoodID;
///
/// Initializes the item template.
///
/// The sprite of the item.
/// The type ID of the item, eg, 0 = walliten, 1 = flooritem, 2 = seat etc.
/// The colour of the item.
/// The length of the item.
/// The width of the item.
/// The topheight of the item, if seat, then this indicates the sitheight. If a solid stackable item, then this is the stackheight. If 0.0, then the item is classified as non-stackable.
/// Specifies if the item can be used as door.
/// Specifies if the item can be traded between virtual users.
/// Specifies if the item can be recycled in the item recycler.
public itemTemplate(string Sprite, byte typeID, string Colour, int Length, int Width, double topH, bool isDoor, bool isTradeable, bool isRecycleable, int templateID, int cost, bool pet, bool costsBelCredits)
{
if (Sprite.Contains(" "))
{
this.Sprite = Sprite.Split(' ')[0];
this.Colour = Sprite.Split(' ')[1];
}
else
{
this.Sprite = Sprite;
this.Colour = Colour;
}
this.typeID = typeID;
this.Length = Length;
this.Width = Width;
this.topH = topH;
this.isDoor = isDoor;
this.isTradeable = isTradeable;
this.isRecycleable = isRecycleable;
this.templateID = templateID;
this.cost = cost;
this.isPet = pet;
this.numberOfUses = 0;
this.petFoodID = 255;
this.costsBelCredits = costsBelCredits;
#region petFlags checking
if (this.Sprite.Contains("goodie") || this.Sprite.Contains("petfood"))
{
if (this.Sprite.Contains("goodie"))
{
this.numberOfUses = 1;
this.petFoodID = 0;
}
else
{
this.numberOfUses = 5;
this.petFoodID = byte.Parse(this.Sprite.Substring(7));
if (petFoodID == 2 || petFoodID == 3)
this.petFoodID = 2;
else if (petFoodID == 4)
this.petFoodID = 3;
}
isPetFood = true;
isPetDrink = false;
isPetToy = false;
}
else if (this.Sprite.Contains("waterbowl"))
{
isPetDrink = true;
isPetToy = false;
isPetFood = false;
}
else if (this.Sprite.Contains("toy"))
{
isPetToy = true;
isPetDrink = false;
isPetFood = false;
}
else
{
isPetToy = false;
isPetFood = false;
isPetDrink = false;
}
#endregion
this.isMoodLight = this.Sprite == "roomdimmer";
this.isSoundMachine = (stringManager.getStringPart(Sprite, 0, 13) == "sound_machine") || (stringManager.getStringPart(Sprite, 0, 13) == "ads_idol_trax") || (stringManager.getStringPart(Sprite, 0, 13) == "nouvelle_trax");
this.isMusicDisk = stringManager.getStringPart(Sprite, 0, 10) == "sound_set_";
if (isMusicDisk)
{
this.musicDiskNumber = int.Parse(Sprite.Substring(10));
}
else
this.musicDiskNumber = 0;
}
}
public class cataloguePage
{
///
/// The display name of the page in the client.
///
internal string displayName;
///
/// The page string of the page, containing the layout, items etc.
///
internal string pageData;
///
/// The minimum rank that a virtual user requires to access this rank.
///
internal byte minRank;
internal List items;
public cataloguePage()
{
this.items = new List();
}
internal void addItem(itemTemplate temp)
{
this.items.Add(temp.templateID);
}
internal bool hasItem(itemTemplate id)
{
return items.Contains(id.templateID);
}
}
public struct deals
{
///
/// Information about the deal
///
public itemTemplate[] dealItemTemplates;
public int[] dealItemAmounts;
///
/// Cost of this item
///
public int cost;
}
}