// // get items by item_kind // public List <Item> GetItems(enumItemKind item_kind) { List <Item> tmp_items = new List <Item>(); for (int i = 0; i < lstItem.Count; i++) { if (lstItem[i].itemKind == item_kind) { tmp_items.Add(lstItem[i]); } } return(tmp_items); }
public List <Item> GetItems(enumItemKind item_kind) { List <Item> lst_item = new List <Item>(); for (int i = 0; i < Backpack.lstItem.Count; i++) { if (Backpack.lstItem[i].itemKind == item_kind) { lst_item.Add(Backpack.lstItem[i]); } } return(lst_item); }
public List <Item> GetItems(enumItemKind item_kind, enumWhoUse item_whouse) { List <Item> tmp_items = new List <Item>(); List <Item> tmp_itemkinds = GetItems(item_kind); for (int i = 0; i < tmp_itemkinds.Count; i++) { if (tmp_itemkinds[i].itemWhoUsed == item_whouse) { tmp_items.Add(tmp_itemkinds[i]); } } return(tmp_items); }
public List <Item> GetItems(bool in_shop, enumItemKind item_kind) { List <Item> tmp_items = new List <Item>(); List <Item> tmp_itemshop = GetItems(in_shop); for (int i = 0; i < tmp_itemshop.Count; i++) { if (tmp_itemshop[i].itemKind == item_kind) { tmp_items.Add(tmp_itemshop[i]); } } return(tmp_items); }
public Item GetItem(enumItemKind item_kind, bool is_random) { List <Item> tmp_items = GetItems(item_kind); if (tmp_items.Count == 0) { return(null); } if (is_random) { return(tmp_items[Random.Range(0, tmp_items.Count)]); } else { return(tmp_items[0]); } }
public List <Item> GetSellItems(enumItemKind item_kind) { if (item_kind == enumItemKind.飾) { return(lstAppraelItem); } else if (item_kind == enumItemKind.裝備) { return(lstEquiementItem); } else if (item_kind == enumItemKind.道具) { return(lstProsItem); } else { return(null); } }
public void btnItemKindClick(int kind) { enumItemKind item_kind = (enumItemKind)kind; RefreshShopItems(shopManager.GetSellItems(item_kind)); }
public void btnItemKindClick(int kind) { enumItemKind item_kind = (enumItemKind)kind; RefreshBackpackItems(backpackManager.GetItems(item_kind)); }