public uint ressourceQuantity(GameRessources ressourcesName)
 {
     if (inventory.ContainsKey (ressourcesName)) {
         return inventory[ressourcesName];
     } else {
         return 0;
     }
 }
 public void addRessource(GameRessources ressourcesName, uint quantity)
 {
     if (inventory.ContainsKey (ressourcesName)) {
         inventory[ressourcesName] = inventory[ressourcesName] + quantity;
     } else {
         inventory[ressourcesName] = quantity;
     }
 }
    public bool useRessource(GameRessources ressourcesName, uint quantity)
    {
        if (inventory.ContainsKey (ressourcesName)) {
            inventory[ressourcesName] = inventory[ressourcesName] - quantity;
        } else {
            inventory[ressourcesName] = 0;
            return false;
        }

        return true;
    }
示例#4
0
 public ItemStack(GameRessources g, int n, Button b)
 {
     gr = g;
     nb = n;
     but = b;
 }
示例#5
0
 public uint getRessourceQuantityInBase(GameRessources ressourcesName)
 {
     return rhb.ressourceQuantity (ressourcesName);
 }
示例#6
0
 public void addRessource(GameRessources ressourcesName, uint quantity)
 {
     rhb.addRessource (ressourcesName, quantity);
 }