private void GenerateItems() { //ArmorName, Defense, Price ShopItems.Add(new Armor("Leather", 4, 8)); ShopItems.Add(new Armor("BreastPlate", 8, 20)); ShopItems.Add(new Armor("Augmented Chain", 15, 45)); ShopItems.Add(new Armor("CorosPlate", 25, 60)); //WeaponName, Strength, Price ShopItems.Add(new Weapon("Recurve bow", 3, 9)); ShopItems.Add(new Weapon("BigAxe", 6, 22)); ShopItems.Add(new Weapon("XV sword", 19, 49)); ShopItems.Add(new Weapon("Arming sword", 29, 65)); //ShieldName, Defense, Price ShopItems.Add(new Shield("Wooden Shield", 3, 10)); ShopItems.Add(new Shield("Battle Shield", 8, 26)); ShopItems.Add(new Shield("Dragon Shield", 15, 40)); //PotionName,HealthRestore, Price Potions.Add(new Potion("Health Potion", 4, 5)); Potions.Add(new Potion("Strong Health Potion", 7, 7)); Potions.Add(new Potion("Great Health Potion", 14, 10)); Potions.Add(new Potion("Gold Health Potion", 19, 13)); }
private void loadSettingsFromToken() { if (SettingToken != null) { if (SettingToken.Metadata.TryGetValue("Name", out string name)) { Name = name; } if (SettingToken.Metadata.TryGetValue("Description", out string desc)) { Description = desc; } try { if (SettingToken.Metadata.TryGetValue("ShopItems", out string shopItems)) { var tsi = JsonConvert.DeserializeObject <List <TokenShopItem> >(shopItems); foreach (var i in tsi) { i.Token = TokenFactory.GetTokenById(TokenTypes.NTP1, i.Name, TokenId, 0.0); ShopItems.Add(i); } } } catch (Exception ex) { log.Error("Cannot load list of ShopItems", ex); } } }
private void ShowItems(String category) { ShopItems.Clear(); using (var context = new NinjaManagerDBEntities1()) { var shopitems = context.Item.Include("Ninja").Where(i => i.category_name == category).ToList(); context.SaveChanges(); foreach (Item i in shopitems) { ShopItems.Add(new ItemViewModel(i)); } } }
// methods private void FetchDataFromApi(ShopItemType type) { switch (type) { case ShopItemType.Food: FoodAPI foodAPI = new FoodAPI(); foodAPI.GetRandomFood(5).ForEach(ShopItems.Add); break; case ShopItemType.Movie: MovieAPI movieAPI = new MovieAPI(); ShopItems.Add(movieAPI.GetRandomMovie()); break; } }
private void AddShopItem(ShopItemType type) { ShopItem shopItem = null; switch (type) { case ShopItemType.Food: shopItem = new Food("New food", 0, 1, "https://i.pinimg.com/originals/5e/fa/77/5efa77186bd7ca39e06aae2bad562351.png", 0, 0); break; case ShopItemType.Movie: shopItem = new Movie("New Movie", 0, 1, "https://image.flaticon.com/icons/png/512/83/83519.png", 0, "unknown"); break; } if (shopItem != null) { ShopItems.Add(shopItem); SelectedShopItem = shopItem; } }
public override void AddItem(IDevice product) { ShopItems.Add(product); }
//voor testing-doelen deze methode gebruikt, wordt verder niet gebruikt //kan misschien nog van pas komen public void Initialize() { ShopItem een = new ShopItem() { Naam = "Kleine Friet", Prijs = 1.2 }; ShopItem twee = new ShopItem() { Naam = "Medium Friet", Prijs = 1.5 }; ShopItem drie = new ShopItem() { Naam = "Chix fingers", Prijs = 1.3 }; ShopItem vier = new ShopItem() { Naam = "Frikandel", Prijs = 1.0 }; ShopItem vijf = new ShopItem() { Naam = "Frikandel speciaal", Prijs = 1.2 }; ShopItem zes = new ShopItem() { Naam = "Bicky burger", Prijs = 3.0 }; ShopItem zeven = new ShopItem() { Naam = "Bicky cheese", Prijs = 3.2 }; ShopItem acht = new ShopItem() { Naam = "Stoofvleessaus", Prijs = 0.5 }; ShopItem negen = new ShopItem() { Naam = "Satékruiden", Prijs = 0.2 }; ShopItem tien = new ShopItem() { Naam = "Pintje 25cl", Prijs = 1.0 }; ShopItems.Add(een); ShopItems.Add(twee); ShopItems.Add(drie); ShopItems.Add(vier); ShopItems.Add(vijf); ShopItems.Add(zes); ShopItems.Add(zeven); ShopItems.Add(acht); ShopItems.Add(negen); ShopItems.Add(tien); }
public override void AddItem(IBook product) { ShopItems.Add(product); }