Esempio n. 1
0
 ItemViewModel(int count, Enums.ItemType itemType, SessionViewModel session)
 {
     this.session = session;
     Count        = count;
     ItemType     = itemType;
     Name         = Enum.GetName(typeof(Enums.ItemType), ItemType);
 }
        public static bool Prefix(ref GameObject __result, Enums.ItemType itemType)
        {
            IPlaceableItemCreator placeableItemCreator = ActivePlaceableItemCreators.GetCreatorFromEnum(itemType);

            if (placeableItemCreator != null)
            {
                __result = placeableItemCreator.Prefab;
                return(false);
            }

            return(true);
        }
Esempio n. 3
0
        private FlowLayoutPanel GetFlowPanel(Enums.ItemType itemType)
        {
            switch (itemType)
            {
            case ItemType.Sword:
                return(flwSword);

            case ItemType.Lance:
                return(flwLance);

            case ItemType.Axe:
                return(flwAxe);

            case ItemType.Shuriken:
                return(flwShuriken);

            case ItemType.Bow:
                return(flwBow);

            case ItemType.Tome:
                return(flwTome);

            case ItemType.Staff:
                return(flwStaff);

            case ItemType.Stone:
            case ItemType.NPC:
                return(flwStone);

            case ItemType.Consumable:
            case ItemType.Held:
                return(flwConsumable);

            default:     // Should never be the case
                return(flwConsumable);
            }
        }
Esempio n. 4
0
 ItemViewModel GetItem(Enums.ItemType itemType) => Items.FirstOrDefault(i => i.ItemType == itemType);
Esempio n. 5
0
 public void Load(int itemNum)
 {
     using (XmlReader reader = XmlReader.Create(Paths.DataPath + "Item\\" + itemNum + ".xml")) {
         while (reader.Read()) {
             if (reader.IsStartElement()) {
                 switch (reader.Name) {
                     case "Name": {
                             Name = reader.ReadString();
                             break;
                         }
                     case "Description": {
                             Desc = reader.ReadString();
                             break;
                         }
                     case "ItemType": {
                             Type = reader.ReadString().ToEnum<Enums.ItemType>();
                             break;
                         }
                     case "Price": {
                             Price = reader.ReadString().ToInt();
                             break;
                         }
                     case "Rarity": {
                             Rarity = reader.ReadString().ToInt();
                             break;
                         }
                     case "Sprite": {
                             Sprite = reader.ReadString().ToInt();
                             break;
                         }
                     case "Requirement": {
                             Req = reader.ReadString().ToInt();
                             break;
                         }
                     case "Req1": {
                             Req1 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Req2": {
                             Req2 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Req3": {
                             Req3 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Req4": {
                             Req4 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Req5": {
                             Req5 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Effect": {
                             Effect = reader.ReadString().ToInt();
                             break;
                         }
                     case "Effect1": {
                             Effect1 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Effect2": {
                             Effect2 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Effect3": {
                             Effect3 = reader.ReadString().ToInt();
                             break;
                         }
                     case "ThrowEffect": {
                             ThrowEffect = reader.ReadString().ToInt();
                             break;
                         }
                     case "Throw1": {
                             Throw1 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Throw2": {
                             Throw2 = reader.ReadString().ToInt();
                             break;
                         }
                     case "Throw3": {
                             Throw3 = reader.ReadString().ToInt();
                             break;
                         }
                 }
             }
         }
     }
 }
Esempio n. 6
0
 public void FillPage(Enums.ItemType itemType)
 {
     FillPage(GetFlowPanel(itemType));
 }
 internal static IPlaceableItemCreator GetCreatorFromEnum(Enums.ItemType itemType)
 {
     return(HasCreatorFromEnum(itemType) ? ActiveEnums[itemType] : null);
 }
 public ColumnConfig(Enums.ItemType itemType)
 {
     ItemType = itemType;
 }
 internal static bool HasCreatorFromEnum(Enums.ItemType itemType)
 {
     return(ActiveEnums.ContainsKey(itemType));
 }
 internal static void Add <T>(IPlaceableItemCreator o, Enums.ItemType itemType) where T : IPlaceableItemCreator
 {
     PlaceableItemCreators.Add(typeof(T), o);
     ActiveEnums.Add(itemType, o);
 }
Esempio n. 11
0
 protected override void PatchedItemTypeEnum(Enums.ItemType itemType)
 {
 }
 protected abstract void PatchedItemTypeEnum(Enums.ItemType itemType);
Esempio n. 13
0
 /// <summary>
 /// Creates and returns a new Microsoft Outlook item.
 /// </summary>
 /// <remarks>The CreateItem method can only create default Outlook items. To create new items using a custom form, use the Add method on the Items collection.</remarks>
 /// <param name="itemType">The Outlook item type for the new item.</param>
 public OutlookItem CreateItem(Enums.ItemType itemType)
 {
     return(OutlookItem.ResolveType(InternalObject.GetType().InvokeMember("CreateItem", System.Reflection.BindingFlags.InvokeMethod, null, InternalObject, new object[] { itemType })));
 }