public void GetDataTest() { Dictionary <ItemType, ItemInfo> infoList = ReadItemData.GetData(); TestItemInfo(infoList[ItemType.Player], name: "Player", itemType: ItemType.Player, character: '@', description: "The Player"); TestItemInfo(infoList[ItemType.Rat], name: "Rat", itemType: ItemType.Rat, character: 'r', description: "A vile little sewer rat. These rodents seem to be everywhere!"); }
public CartInfo GetCartInfo(string items) { IGetItem readObject = new ReadItemData(); CartInfo r = new CartInfo(); var split = items.Split(','); //SubTotal double subtotal = 0.0; foreach (var item in split) { //Change this to parse var data = readObject.GetItem(Convert.ToInt32(item)); r.Items.Add(data); subtotal += data.ItemPrice; } r.Subtotal = subtotal; //Discount //if(user.rewards >= 5) //{ var newTotal = (r.Subtotal * (1 - 0.1)); //} //Tax r.Tax = Math.Round((subtotal * 0.1), 2); //Rewards r.Rewards = (int)((r.Subtotal - (r.Subtotal % 10)) / 10); return(r); }
public Item GetItem(int id) { //System.Console.WriteLine("Returned an id of: " + id); IGetItem getItem = new ReadItemData(); return(getItem.GetAnItem(id)); }
public Item Get(int id) { IGetItem readObject = new ReadItemData(); return(readObject.GetItem(id)); }
public List <Item> ReadItems() { IGetAllItems readObject = new ReadItemData(); return(readObject.GetAllItems()); }
public List <Item> GetAllItems() { IGetAllItems allItems = new ReadItemData(); return(allItems.GetAllItems()); }