public bool Consume(eResource r, int amount)
 {
     if (stock[r] >= amount)
     {
         stock[r] -= amount;
         return(true);
     }
     return(false);
 }
    public Sprite GetResource(eResource resource)
    {
        int id = (int)resource;

        if (id > resourceIcon.Length)
        {
            return(defaultSprite);
        }
        return(resourceIcon[id]);
    }
 public int Add(eResource r, int amount)
 {
     stock[r] += amount;
     return(stock[r]);
 }
 public int Get(eResource r)
 {
     return(stock[r]);
 }
Exemple #5
0
 public string ResourceLabel(eResource value)
 {
     return(ResourceListLabel[(int)value]);
 }
Exemple #6
0
 public string ResourceField(eResource value)
 {
     return(ResourceList[(int)value]);
 }
Exemple #7
0
 public Ingredient(eResource r, int a)
 {
     resource = r;
     amount   = a;
 }