コード例 #1
0
    public void add_item(scripted_item _item, int amount)
    {
        bool has_item = false;

        for (int i = 0; i < inventory_list.Count; i++)
        {
            if (inventory_list[i].item == _item)
            {
                inventory_list[i].add_amount(amount);
                has_item = true;
            }
        }
        if (!has_item)
        {
            inventory_list.Add(new inventory_slot(_item, amount));
        }
    }
コード例 #2
0
 public inventory_slot(scripted_item _item, int _amount_of_items)
 {
     this.item            = _item;
     this.amount_of_items = _amount_of_items;
 }