예제 #1
0
 public CraftingDictinaryEntry(String name, int value, int weight, Listof_ResourceItem r1, int c1)
 {
     Name   = name;
     Value  = value;
     Weight = weight;
     ResourceCost.Add(r1, c1);
 }
예제 #2
0
 public void RemoveResource(Listof_ResourceItem i, int amount)
 {
     if (Resources.ContainsKey(i))
     {
         Resources[i] -= amount;
         if (Resources[i] <= 0)
         {
             Resources.Remove(i);
         }
     }
 }
예제 #3
0
 public int ResourceCount(Listof_ResourceItem i)
 {
     if (Resources.ContainsKey(i))
     {
         return(Resources[i]);
     }
     else
     {
         return(0);
     }
 }
예제 #4
0
 //Resources
 public void AddResource(Listof_ResourceItem i, int amount)
 {
     if (Resources.ContainsKey(i))
     {
         Resources[i] += amount;
     }
     else
     {
         Resources.Add(i, amount);
     }
 }