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

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