Ejemplo n.º 1
0
        // Remove ItemModel from a set location
        // Does this by adding a new ItemModel of Null to the location
        // This will return the previous ItemModel, and put null in its place
        // Returns the ItemModel that was at the location
        // Nulls out the location
        public ItemModel RemoveItem(ItemLocationEnum itemlocation)
        {
            var myReturn = AddItem(itemlocation, null);

            // Save Changes
            return(myReturn);
        }
Ejemplo n.º 2
0
        // Get the ItemModel at a known string location (head, foot etc.)
        public ItemModel GetItemByLocation(ItemLocationEnum itemLocation)
        {
            switch (itemLocation)
            {
            case ItemLocationEnum.Head:
                return(GetItem(Head));

            case ItemLocationEnum.Necklass:
                return(GetItem(Necklass));

            case ItemLocationEnum.PrimaryHand:
                return(GetItem(PrimaryHand));

            case ItemLocationEnum.OffHand:
                return(GetItem(OffHand));

            case ItemLocationEnum.RightFinger:
                return(GetItem(RightFinger));

            case ItemLocationEnum.LeftFinger:
                return(GetItem(LeftFinger));

            case ItemLocationEnum.Feet:
                return(GetItem(Feet));
            }

            return(null);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Get a Random Item for the Location
        ///
        /// Return the String for the ID
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public static string GetItem(ItemLocationEnum location)
        {
            var ItemList = ItemIndexViewModel.Instance.GetLocationItems(location);

            if (ItemList.Count == 0)
            {
                return(null);
            }

            // Add None to the list
            ItemList.Add(new ItemModel {
                Id = null, Name = "None"
            });

            var result = ItemList.First().Id;

            var index = DiceHelper.RollDice(1, ItemList.Count()) - 1;

            if (index < ItemList.Count)
            {
                result = ItemList.ElementAt(index).Id;
            }

            return(result);
        }
        public async Task HttpClientService_GetJsonPostAsync_InValid_Bogus_Should_Fail()
        {
            // Arrange
            var RestUrl = "bogus";

            int              number    = 0;
            int              level     = 0;
            AttributeEnum    attribute = AttributeEnum.Attack;
            ItemLocationEnum location  = ItemLocationEnum.Feet;
            int              category  = 0;
            bool             random    = false;

            var dict = new Dictionary <string, string>
            {
                { "Number", number.ToString() },
                { "Level", level.ToString() },
                { "Attribute", ((int)attribute).ToString() },
                { "Location", ((int)location).ToString() },
                { "Random", random.ToString() },
                { "Category", category.ToString() },
            };

            // Convert parameters to a key value pairs to a json object
            JObject finalContentJson = (JObject)JToken.FromObject(dict);

            // Act
            var result = await Service.GetJsonPostAsync(RestUrl, finalContentJson);

            // Reset

            // Assert
            Assert.AreEqual(null, result);
        }
        /// <summary>
        /// Swap out the item if it is better
        ///
        /// Uses Value to determine
        /// </summary>
        /// <param name="character"></param>
        /// <param name="setLocation"></param>
        public bool GetItemFromPoolIfBetter(PlayerInfoModel character, ItemLocationEnum setLocation)
        {
            var myList = ItemPool.Where(a => a.Location == setLocation)
                         .OrderByDescending(a => a.Value)
                         .ToList();

            // If no items in the list, return...
            if (!myList.Any())
            {
                return(false);
            }

            var CharacterItem = character.GetItemByLocation(setLocation);

            if (CharacterItem == null)
            {
                SwapCharacterItem(character, setLocation, myList.FirstOrDefault());
                return(true);
            }

            foreach (var PoolItem in myList)
            {
                if (PoolItem.Value > CharacterItem.Value)
                {
                    SwapCharacterItem(character, setLocation, PoolItem);
                    return(true);
                }
            }

            return(true);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Get an item from the server for a loaction if the character does not have item in the location
        /// </summary>
        /// <param name="Character"></param>
        /// <param name="Location"></param>
        /// <returns></returns>
        public override ItemModel GetDeliveryForNullItem(PlayerInfoModel Character, ItemLocationEnum Location)
        {
            // Get the current item on Character
            ItemModel CurrentItem = GetLocationItem(Character, Location);

            // Not null, return
            if (CurrentItem != null)
            {
                return(null);
            }

            // Get an item of given location from server
            var task = ItemService.GetItemsFromServerPostAsync(1, 20, AttributeEnum.Unknown, Location, 0, true, true);

            task.Wait();

            // Does not return items from server
            if (task.Result.Count() == 0)
            {
                return(null);
            }

            // Return the item
            return(task.Result[0]);
        }
Ejemplo n.º 7
0
        /// <summary>
        /// Get the current item on given location on given Character
        /// </summary>
        /// <param name="Character"></param>
        /// <param name="Location"></param>
        /// <returns></returns>
        public override ItemModel GetLocationItem(PlayerInfoModel Character, ItemLocationEnum Location)
        {
            switch (Location)
            {
            case ItemLocationEnum.Feet:
                return(ItemIndexViewModel.Instance.GetItem(Character.Feet));

            case ItemLocationEnum.Head:
                return(ItemIndexViewModel.Instance.GetItem(Character.Head));

            case ItemLocationEnum.LeftFinger:
                return(ItemIndexViewModel.Instance.GetItem(Character.LeftFinger));

            case ItemLocationEnum.RightFinger:
                return(ItemIndexViewModel.Instance.GetItem(Character.RightFinger));

            case ItemLocationEnum.PrimaryHand:
                return(ItemIndexViewModel.Instance.GetItem(Character.PrimaryHand));

            case ItemLocationEnum.OffHand:
                return(ItemIndexViewModel.Instance.GetItem(Character.OffHand));

            case ItemLocationEnum.Necklass:
                return(ItemIndexViewModel.Instance.GetItem(Character.Necklass));

            case ItemLocationEnum.Pokeball:
                return(ItemIndexViewModel.Instance.GetItem(Character.Pokeball));

            default:
                return(null);
            }
        }
Ejemplo n.º 8
0
        // Add Item
        // Looks up the Item
        // Puts the Item ID as a string in the location slot
        // If item is null, then puts null in the slot
        // Returns the item that was in the location
        public Item AddItem(ItemLocationEnum itemlocation, string itemID)
        {
            Item myReturn = new Item();

            // Implement

            return(myReturn);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// Get all the items for a set location
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public List <ItemModel> GetLocationItems(ItemLocationEnum location)
        {
            List <ItemModel> data = null;

            data = Dataset.Where(m => m.Location == location).ToList();

            return(data);
        }
Ejemplo n.º 10
0
        /// <summary>
        /// Look up the Item to Display
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public StackLayout GetItemToDisplay(ItemLocationEnum location)
        {
            // Defualt Image is the Plus
            var ImageSource     = "icon_cancel.png";
            var ClickableButton = true;

            // Get ItemModel
            var data = ViewModel.Data.GetItemByLocation(location);

            // ItemModel is null, no item in the location
            if (data == null)
            {
                // Show the Default Icon for the Location
                data = new ItemModel {
                    Location = location, ImageURI = ImageSource
                };

                // Turn off click action
                ClickableButton = false;
            }

            // Hookup the Image Button to show the Item picture
            var ItemButton = new ImageButton
            {
                Style  = (Style)Application.Current.Resources["ImageMediumStyle"],
                Source = data.ImageURI
            };

            if (ClickableButton)
            {
                // Add a event to the user can click the item and see more
                ItemButton.Clicked += (sender, args) => ShowPopupItem_Clicked(data);
            }

            // Add the Display Text for the item
            var ItemLabel = new Label
            {
                Text                    = location.ToMessage(),
                Style                   = (Style)Application.Current.Resources["ValueStyleMicro"],
                HorizontalOptions       = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center,
            };

            // Put the Image Button and Text inside a layout
            var ItemStack = new StackLayout
            {
                Padding           = new Thickness(15, 12),
                Style             = (Style)Application.Current.Resources["ItemImageBox"],
                HorizontalOptions = LayoutOptions.Center,
                Children          =
                {
                    ItemButton,
                    ItemLabel
                },
            };

            return(ItemStack);
        }
        /// <summary>
        /// Look up the Item to Display
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public StackLayout GetItemToDisplay(ItemLocationEnum location)
        {
            // Defualt Image is the Plus
            var ImageSource     = "https://icons.iconarchive.com/icons/google/noto-emoji-smileys/1024/10024-thinking-face-icon.png";
            var ClickableButton = true;

            var data = ViewModel.Data.GetItemByLocation(location);

            if (data == null)
            {
                // Show the Default Icon for the Location
                data = new ItemModel {
                    Location = location, ImageURI = ImageSource
                };

                // Turn off click action
                ClickableButton = false;
            }

            // Hookup the Image Button to show the Item picture
            var ItemButton = new ImageButton
            {
                Style  = (Style)Application.Current.Resources["ImageMediumStyle"],
                Source = data.ImageURI
            };

            if (ClickableButton)
            {
                // Add a event to the user can click the item and see more
                ItemButton.Clicked += (sender, args) => ShowPopup(data);
            }

            // Add the Display Text for the item
            var ItemLabel = new Label
            {
                Text                    = location.ToMessage(),
                Style                   = (Style)Application.Current.Resources["ValueStyle"],
                HorizontalOptions       = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center
            };

            // Put the Image Button and Text inside a layout
            var ItemStack = new StackLayout
            {
                Padding           = 3,
                Style             = (Style)Application.Current.Resources["ItemImageBox"],
                HorizontalOptions = LayoutOptions.Center,
                Children          =
                {
                    ItemButton,
                    ItemLabel
                },
            };

            return(ItemStack);
        }
        /// <summary>
        /// Helper method to check if the location is holding an item
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public bool CheckItemExist(ItemLocationEnum location)
        {
            var data = ViewModel.Data.GetItemByLocation(location);

            if (data == null)
            {
                return(false);
            }
            return(true);
        }
Ejemplo n.º 13
0
 //This void type method will help character to resign items. If characters get new items and this method will replace the new item for character.
 //This is a reusable block of code and we could use it in different classes.
 public void EquipItem(Item item, ItemLocationEnum location)
 {
     if (EquippedItem.ContainsKey(location))
     {
         EquippedItem.Remove(location);
     }
     EquippedItem.Add(location, item);
     //EquippedItemList.Add(item.Name);
     UpdateEquippedItemListString();
 }
Ejemplo n.º 14
0
        /// <summary>
        /// Get the ID of the Default Item for the Location
        /// The Default item is the first Item in the List
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public string GetDefaultItemId(ItemLocationEnum location)
        {
            var data = GetDefaultItem(location);

            if (data == null)
            {
                return(null);
            }

            return(data.Id);
        }
Ejemplo n.º 15
0
 /// <summary>
 /// Finds an item suitable for a given location
 /// </summary>
 /// <param name="location"></param>
 /// <param name="items"></param>
 /// <returns></returns>
 public ItemModel FindItemForLocation(ItemLocationEnum location, List <ItemModel> items)
 {
     foreach (var item in items)
     {
         if (item.Location.ToString() == location.ToString())
         {
             return(item);
         }
     }
     return(null);
 }
Ejemplo n.º 16
0
        // Add Item
        // Looks up the Item
        // Puts the Item ID as a string in the location slot
        // If item is null, then puts null in the slot
        // Returns the item that was in the location
        public Item AddItem(ItemLocationEnum itemlocation, string itemID)
        {
            Item myReturn;

            switch (itemlocation)
            {
            case ItemLocationEnum.Feet:
                myReturn = GetItem(Feet);
                Feet     = itemID;
                break;

            case ItemLocationEnum.Head:
                myReturn = GetItem(Head);
                Head     = itemID;
                break;

            case ItemLocationEnum.Necklass:
                myReturn = GetItem(Necklass);
                Necklass = itemID;
                break;

            case ItemLocationEnum.PrimaryHand:
                myReturn    = GetItem(PrimaryHand);
                PrimaryHand = itemID;
                break;

            case ItemLocationEnum.OffHand:
                myReturn = GetItem(OffHand);
                OffHand  = itemID;
                break;

            case ItemLocationEnum.RightFinger:
                myReturn    = GetItem(RightFinger);
                RightFinger = itemID;
                break;

            case ItemLocationEnum.LeftFinger:
                myReturn   = GetItem(LeftFinger);
                LeftFinger = itemID;
                break;

            case ItemLocationEnum.Bag:
                myReturn = GetItem(Bag);
                Bag      = itemID;
                break;

            default:
                myReturn = null;
                break;
            }

            return(myReturn);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// The item selected from the list. Set location to the item and update selected view.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="args"></param>
        public void PopupItemSelected(ItemModel data, ItemLocationEnum location)
        {
            // If data is null, return
            if (data == null)
            {
                return;
            }

            // Set item to corresponding location
            switch (location)
            {
            case ItemLocationEnum.PrimaryHand:
                ViewModel.Data.PrimaryHand = data.Id;
                break;

            case ItemLocationEnum.OffHand:
                ViewModel.Data.OffHand = data.Id;
                break;

            case ItemLocationEnum.Necklass:
                ViewModel.Data.Necklass = data.Id;
                break;

            case ItemLocationEnum.Feet:
                ViewModel.Data.Feet = data.Id;
                break;

            case ItemLocationEnum.LeftFinger:
                ViewModel.Data.LeftFinger = data.Id;
                break;

            case ItemLocationEnum.RightFinger:
                ViewModel.Data.RightFinger = data.Id;
                break;

            case ItemLocationEnum.Head:
                ViewModel.Data.Head = data.Id;
                break;

            case ItemLocationEnum.Pokeball:
                ViewModel.Data.Pokeball = data.Id;
                break;

            default:
                return;

                break;
            }

            // Update selected view
            UpdatePopupSelectedItemValues(data);
        }
Ejemplo n.º 18
0
        //Method to get item at location
        public string GetItemAtLocation(ItemLocationEnum itemlocation)
        {
            Item myReturn;

            switch (itemlocation)
            {
            case ItemLocationEnum.Feet:
                myReturn = GetItem(Feet);
                //Feet = itemID;
                break;

            case ItemLocationEnum.Head:
                myReturn = GetItem(Head);
                //Head = itemID;
                break;

            case ItemLocationEnum.Necklass:
                myReturn = GetItem(Necklass);
                //  Necklass = itemID;
                break;

            case ItemLocationEnum.PrimaryHand:
                myReturn = GetItem(PrimaryHand);
                //  PrimaryHand = itemID;
                break;

            case ItemLocationEnum.OffHand:
                myReturn = GetItem(OffHand);
                //  OffHand = itemID;
                break;

            case ItemLocationEnum.RightFinger:
                myReturn = GetItem(RightFinger);
                //  RightFinger = itemID;
                break;

            case ItemLocationEnum.LeftFinger:
                myReturn = GetItem(LeftFinger);
                // LeftFinger = itemID;
                break;

            default:
                myReturn = null;
                break;
            }
            if (myReturn == null)
            {
                myReturn      = new Item();
                myReturn.Name = "no Item";
            }
            return(myReturn.Name);
        }
Ejemplo n.º 19
0
        // Constructor for Item called if needed to create a new item with set values.
        public Item(string name, string description, string imageuri, string guid, int range, int value, ItemLocationEnum location, AttributeEnum attribute)
        {
            Name        = name;
            Description = description;
            Guid        = guid;
            ImageURI    = imageuri;

            Range = range;
            Value = value;

            Location  = location;
            Attribute = attribute;
        }
Ejemplo n.º 20
0
        /// <summary>
        /// Get the First item of the location from the list
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public ItemModel GetDefaultItem(ItemLocationEnum location)
        {
            var dataList = GetLocationItems(location);

            if (dataList.Count() == 0)
            {
                return(null);
            }

            var data = dataList.FirstOrDefault();

            return(data);
        }
Ejemplo n.º 21
0
        public Item(string name, string description, string imageUri,
                    AttributeEnum attribute, ItemLocationEnum location, int value, int damage)
        {
            CreateDefaultItem();

            Name        = name;
            Description = description;
            ImageURI    = imageUri;
            Attribute   = attribute;
            Location    = location;
            Value       = value;
            Damage      = damage;
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Get a Random Item for the Location
        ///
        /// Return the String for the ID
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public static string GetItem(ItemLocationEnum location)
        {
            var ItemList = ItemIndexViewModel.Instance.GetLocationItems(location);

            // Add Noe to the list
            ItemList.Add(new ItemModel {
                Id = null, Name = "None"
            });

            var result = ItemList.ElementAt(DiceHelper.RollDice(1, ItemList.Count()) - 1).Id;

            return(result);
        }
Ejemplo n.º 23
0
        /// <summary>
        /// Look up the Item to Display
        /// </summary>
        /// <param name="location"></param>
        /// <returns></returns>
        public StackLayout GetItemToDisplay(ItemLocationEnum location)
        {
            // Get the Item, if it exist show the info
            // If it does not exist, show a Plus Icon for the location

            // Defualt Image is the Plus
            var ImageSource = "icon_add.png";

            var data = ViewModel.Data.GetItemByLocation(location);

            if (data == null)
            {
                data = new ItemModel {
                    Location = location, ImageURI = ImageSource
                };
            }

            // Hookup the Image Button to show the Item picture
            var ItemButton = new ImageButton
            {
                Style  = (Style)Application.Current.Resources["ImageMediumStyle"],
                Source = data.ImageURI
            };

            // Add a event to the user can click the item and see more
            ItemButton.Clicked += (sender, args) => ShowPopup(location);

            // Add the Display Text for the item
            var ItemLabel = new Label
            {
                Text                    = location.ToMessage(),
                Style                   = (Style)Application.Current.Resources["ValueStyleMicro"],
                HorizontalOptions       = LayoutOptions.Center,
                HorizontalTextAlignment = TextAlignment.Center
            };

            // Put the Image Button and Text inside a layout
            var ItemStack = new StackLayout
            {
                Padding           = 3,
                Style             = (Style)Application.Current.Resources["ItemImageBox"],
                HorizontalOptions = LayoutOptions.Center,
                Children          =
                {
                    ItemButton,
                    ItemLabel
                },
            };

            return(ItemStack);
        }
Ejemplo n.º 24
0
        /// <summary>
        /// Show the Popup for the Item
        /// </summary>
        /// <param name="data"></param>
        /// <returns></returns>
        public bool ShowPopup(ItemLocationEnum data)
        {
            PopupLoadingView.IsVisible = true;

            PopupLocationLabel.Text = "Avaliable Items for: " + data.ToMessage();
            PopupLocationValue.Text = data.ToMessage();

            PopupLocationItemListView.ItemsSource = ItemIndexViewModel.Instance.GetLocationItems(data);

            PopupLocationEnum = data;


            return(true);
        }
Ejemplo n.º 25
0
        /// <summary>
        /// Show the Popup for the Item
        /// </summary>
        /// <param name="data"></param>
        /// <param name="location"></param>
        /// <returns></returns>
        public bool ShowPopup(ItemModel data, ItemLocationEnum location)
        {
            // Show the Popup View
            PopupLoadingView.IsVisible = true;

            // Update the displayed selected item as the current item
            UpdatePopupSelectedItemValues(data);

            // Get List of ItemModels for list, and bind click function
            PopupListView.ItemsSource   = new ObservableCollection <ItemModel>(ItemListModel.GetLocationItems(location));
            PopupListView.ItemSelected += (sender, args) => PopupItemSelected((ItemModel)args.SelectedItem, location);

            return(true);
        }
Ejemplo n.º 26
0
        // Add Item
        // Looks up the Item
        // Puts the Item ID as a string in the location slot
        // If item is null, then puts null in the slot
        // Returns the item that was in the location
        public Item AddItem(ItemLocationEnum itemLocation, string itemId)
        {
            Item item      = null;
            var  _prevItem = "";

            if (itemId != null)
            {
                item = GetItem(itemId);
            }

            switch (itemLocation)
            {
            case ItemLocationEnum.Head:
                _prevItem = this.Head;
                this.Head = item?.Id;
                break;

            case ItemLocationEnum.Necklass:
                _prevItem     = this.Necklace;
                this.Necklace = item?.Id;
                break;

            case ItemLocationEnum.PrimaryHand:
                _prevItem        = this.PrimaryHand;
                this.PrimaryHand = item?.Id;
                break;

            case ItemLocationEnum.OffHand:
                _prevItem    = this.OffHand;
                this.OffHand = item?.Id;
                break;

            case ItemLocationEnum.RightFinger:
                _prevItem        = this.RightFinger;
                this.RightFinger = item?.Id;
                break;

            case ItemLocationEnum.LeftFinger:
                _prevItem       = this.LeftFinger;
                this.LeftFinger = item?.Id;
                break;

            case ItemLocationEnum.Feet:
                _prevItem = this.Feet;
                this.Feet = item?.Id;
                break;
            }
            return(GetItem(_prevItem));
        }
Ejemplo n.º 27
0
        public async Task HttpClientService_GetJsonPostAsync_InValid_Moq_Bad_Response_Should_Fail()
        {
            // Arrange

            var MockHttpClient = new HttpClient(new MockHttpMessageHandler());

            var RestUrl = "http://some.fake.url";

            var OldHttpClient = Service.GetHttpClient();

            Service.SetHttpClient(MockHttpClient);

            ResponseMessage.SetResponseMessageStringContent(ResponseMessage.NullStringContent);
            ResponseMessage.SetHttpStatusCode(ResponseMessage.HttpStatusCodeBadRequest);

            int              number    = 0;
            int              level     = 0;
            AttributeEnum    attribute = AttributeEnum.Attack;
            ItemLocationEnum location  = ItemLocationEnum.Feet;
            int              category  = 0;
            bool             random    = false;

            var dict = new Dictionary <string, string>
            {
                { "Number", number.ToString() },
                { "Level", level.ToString() },
                { "Attribute", ((int)attribute).ToString() },
                { "Location", ((int)location).ToString() },
                { "Random", random.ToString() },
                { "Category", category.ToString() },
            };

            // Convert parameters to a key value pairs to a json object
            JObject finalContentJson = (JObject)JToken.FromObject(dict);

            // Act
            var result = await Service.GetJsonPostAsync(RestUrl, finalContentJson);

            // Parse them
            var resultList = ItemModelJsonHelper.ParseJson(result);

            // Reset
            Service.SetHttpClient(OldHttpClient);
            ResponseMessage.ResetResponseMessageStringContent();
            ResponseMessage.ResetHttpStatusCode();

            // Assert
            Assert.AreEqual(null, resultList);
        }
Ejemplo n.º 28
0
        /// <summary>
        /// Display a String for the Enums
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static string ToMessage(this ItemLocationEnum value)
        {
            // Default String
            var Message = "Unknown";

            switch (value)
            {
            case ItemLocationEnum.Head:
                Message = "Head";
                break;

            case ItemLocationEnum.Necklass:
                Message = "Necklass";
                break;

            case ItemLocationEnum.PrimaryHand:
                Message = "Primary Hand";
                break;

            case ItemLocationEnum.OffHand:
                Message = "Off Hand";
                break;

            case ItemLocationEnum.RightFinger:
                Message = "Right Finger";
                break;

            case ItemLocationEnum.LeftFinger:
                Message = "Left Finger";
                break;

            case ItemLocationEnum.Finger:
                Message = "Any Finger";
                break;

            case ItemLocationEnum.Feet:
                Message = "Feet";
                break;

            case ItemLocationEnum.Pokeball:
                Message = "Pokeball";
                break;

            case ItemLocationEnum.Unknown:
            default:
                break;
            }
            return(Message);
        }
Ejemplo n.º 29
0
        public Item AddItem(ItemLocationEnum itemlocation, string itemID) //Item will added depending upon the location of the character
        {
            Item myReturn;

            switch (itemlocation)
            {
            //If it's feet the item will be assigned there and similarly for others
            case ItemLocationEnum.Feet:
                myReturn = GetItem(Feet);
                Feet     = itemID;
                break;

            case ItemLocationEnum.Head:
                myReturn = GetItem(Head);
                Head     = itemID;
                break;

            case ItemLocationEnum.Necklass:
                myReturn = GetItem(Necklass);
                Necklass = itemID;
                break;

            case ItemLocationEnum.PrimaryHand:
                myReturn    = GetItem(PrimaryHand);
                PrimaryHand = itemID;
                break;

            case ItemLocationEnum.OffHand:
                myReturn = GetItem(OffHand);
                OffHand  = itemID;
                break;

            case ItemLocationEnum.RightFinger:
                myReturn    = GetItem(RightFinger);
                RightFinger = itemID;
                break;

            case ItemLocationEnum.LeftFinger:
                myReturn   = GetItem(LeftFinger);
                LeftFinger = itemID;
                break;

            default:
                myReturn = null;
                break;
            }

            return(myReturn);
        }
Ejemplo n.º 30
0
        public static Item AddItemForAttribute(AttributeEnum attributeEnum, ItemLocationEnum itemLocationEnum, int value)
        {
            MockForms.Init();

            var myItem = new Item
            {
                Attribute = attributeEnum,
                Location  = itemLocationEnum,
                Value     = value
            };

            ItemsViewModel.Instance.AddAsync(myItem).GetAwaiter().GetResult();  // Register Item to DataSet

            return(myItem);
        }