示例#1
0
 public void CreateItem(Character c, ItemShort[] items)
 {
     bool created = false;
     for(int i=0; i<this.recipe.Length; i++)
     {
         if(this.recipe[i].CanCreate(items))
         {
             this.recipe[i].CreateItem(c, items);
             created = true;
             break;
         }
     }
     if(!created)
     {
         for(int i=0; i<items.Length; i++)
         {
             items[i].RemoveFromInventory();
         }
     }
 }
示例#2
0
 public bool Equals(ItemShort item)
 {
     return (this.type == item.type && this.id == item.id && this.quantity == item.quantity);
 }
示例#3
0
 private ItemShort ItemSettings(ItemShort ingredient)
 {
     ItemDropType tmp = ingredient.type;
     ingredient.type = (ItemDropType)this.EnumToolbar("Type", (int)ingredient.type, typeof(ItemDropType));
     if(tmp != ingredient.type) ingredient.id = 0;
     if(ItemDropType.ITEM.Equals(ingredient.type))
     {
         ingredient.id = EditorGUILayout.Popup("Item", ingredient.id, DataHolder.Items().GetNameList(true), GUILayout.Width(pw.mWidth));
     }
     else if(ItemDropType.WEAPON.Equals(ingredient.type))
     {
         ingredient.id = EditorGUILayout.Popup("Weapon", ingredient.id, DataHolder.Weapons().GetNameList(true), GUILayout.Width(pw.mWidth));
     }
     else if(ItemDropType.ARMOR.Equals(ingredient.type))
     {
         ingredient.id = EditorGUILayout.Popup("Armor", ingredient.id, DataHolder.Armors().GetNameList(true), GUILayout.Width(pw.mWidth));
     }
     ingredient.quantity = EditorGUILayout.IntField("Quantity", ingredient.quantity, GUILayout.Width(pw.mWidth));
     if(ingredient.quantity < 1) ingredient.quantity = 1;
     EditorGUILayout.Separator();
     return ingredient;
 }
示例#4
0
 public static ItemShort[] Remove(int index, ItemShort[] list)
 {
     ArrayList tmp = new ArrayList();
     foreach(ItemShort str in list) tmp.Add(str);
     tmp.RemoveAt(index);
     return tmp.ToArray(typeof(ItemShort)) as ItemShort[];
 }
示例#5
0
 public static ItemShort[] Add(ItemShort n, ItemShort[] list)
 {
     ArrayList tmp = new ArrayList();
     foreach(ItemShort str in list) tmp.Add(str);
     tmp.Add(n);
     return tmp.ToArray(typeof(ItemShort)) as ItemShort[];
 }