Exemple #1
0
        public void Open(string path)
        {
            BeforeOpening(path);
            base.OpenInstance(path);

            //    Activity

            ItemObjectDefinition ActivityDefinition = new ItemObjectDefinition();

            ActivityDefinition.AddAttributeProperty("Description", x => (x as Activity).DescriptionProperty);
            ActivityDefinition.AddAttributeProperty("From", x => (x as Activity).FromProperty);
            ActivityDefinition.AddAttributeProperty("To", x => (x as Activity).ToProperty);
            ActivityDefinition.AddAssociation("Incurred", "Incurred", x => (x as Activity).Incurred);
            SetActivator("Activity", (initializer) => new Activity(initializer), ActivityDefinition);

            //    Expense

            ItemObjectDefinition ExpenseDefinition = new ItemObjectDefinition();

            ExpenseDefinition.AddAttributeProperty("Amount", x => (x as Expense).AmountProperty);
            ExpenseDefinition.AddAttributeProperty("Date", x => (x as Expense).DateProperty);
            ExpenseDefinition.AddAttributeProperty("Description", x => (x as Expense).DescriptionProperty);
            ExpenseDefinition.AddAssociationProperty("IncurredOn", "IncurredOn", x => (x as Expense).IncurredOnProperty);
            SetActivator("Expense", (initializer) => new Expense(initializer), ExpenseDefinition);
            ActivityItems = new ItemObjects <Activity>(connection_.GetItemType("Activity"), this, "ActivityItems");
            ExpenseItems  = new ItemObjects <Expense>(connection_.GetItemType("Expense"), this, "ExpenseItems");
        }
Exemple #2
0
        public static ItemObjects ItemObjects(Item item)
        {
            ItemObjects inheritedItem = null;

            switch (item.Name)
            {
            case "+5 Dexterity Vest":
                inheritedItem = new DexterityVest(item);
                break;

            case "Aged Brie":
                inheritedItem = new AgedBrie(item);
                break;

            case "Elixir of the Mongoose":
                inheritedItem = new ElixirOfTheMongoose(item);
                break;

            case "Sulfuras, Hand of Ragnaros":
                inheritedItem = new Sulfuras(item);
                break;

            case "Backstage passes to a TAFKAL80ETC concert":
                inheritedItem = new BackstagePasses(item);
                break;

            case "Conjured Mana Cake":
                inheritedItem = new Conjured(item);
                break;
            }
            return(inheritedItem);
        }
 public Item(ItemObjects item)
 {
     Name  = item.name;
     Id    = item.Id;
     buffs = new ItemBuff[item.buffs.Length];
     for (int i = 0; i < buffs.Length; i++)
     {
         buffs[i] = new ItemBuff(item.buffs[i].min, item.buffs[i].max); //wait on random value generation
         {
             buffs[i].attribute = item.buffs[i].attribute;
         }
     }
 }
Exemple #4
0
 public Item(
     ItemTypes _ItemType,
     ItemObjects _ItemObject,
     GearTypes _GearType,
     Rarities _Rarity,
     List <BaseStat> _BaseStats,
     List <BaseStat> _BaseSuffixStats,
     List <BaseStat> _RndSuffixStats,
     int _ItemLevel,
     string _ObjectSlug,
     string _Description,
     string _ActionName,
     string _ItemName,
     bool _IsStackable
     )
 {
     this.BaseStats      = _BaseStats;
     this.RndSuffixStats = _RndSuffixStats;
     this.ObjectSlug     = _ObjectSlug;
     this.Description    = _Description;
     this.Rarity         = _Rarity;
     this.ItemObject     = _ItemObject;
     this.ItemType       = _ItemType;
     this.ActionName     = _ActionName;
     this.ItemName       = _ItemName;
     this.IsStackable    = _IsStackable;
     itemToGearTypes     = new Dictionary <ItemObjects, List <GearTypes> >();
     itemToGearTypes.Add(ItemObjects.Armor, new List <GearTypes> {
         GearTypes.Armor, GearTypes.Gloves, GearTypes.Helmet, GearTypes.Pants, GearTypes.Shoes
     });
     itemToGearTypes.Add(ItemObjects.Jewelery, new List <GearTypes> {
         GearTypes.Armor, GearTypes.Gloves, GearTypes.Helmet, GearTypes.Pants, GearTypes.Shoes
     });
     itemToGearTypes.Add(ItemObjects.Weapon, new List <GearTypes> {
         GearTypes.Armor, GearTypes.Gloves, GearTypes.Helmet, GearTypes.Pants, GearTypes.Shoes
     });
 }
 public void AddComment(TmpComment comment)
 {
     ItemObjects.Add(new TmpItemLevelObject(comment));
 }
 public void AddAttribute(TmpInterfaceAttribute attr)
 {
     ItemObjects.Add(new TmpItemLevelObject(attr));
 }
Exemple #7
0
 /// <summary>
 /// Initializes the ViewModel class
 /// </summary>
 public ViewModel()
 {
     itemObjectCollection = ItemObjects.GetList();
 }