Ejemplo n.º 1
0
 public bool Consume(eResource r, int amount)
 {
     if (stock[r] >= amount)
     {
         stock[r] -= amount;
         return(true);
     }
     return(false);
 }
Ejemplo n.º 2
0
    public Sprite GetResource(eResource resource)
    {
        int id = (int)resource;

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