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;
    }
Exemplo n.º 4
0
 public ItemStack(GameRessources g, int n, Button b)
 {
     gr = g;
     nb = n;
     but = b;
 }
Exemplo n.º 5
0
 public uint getRessourceQuantityInBase(GameRessources ressourcesName)
 {
     return rhb.ressourceQuantity (ressourcesName);
 }
Exemplo n.º 6
0
 public void addRessource(GameRessources ressourcesName, uint quantity)
 {
     rhb.addRessource (ressourcesName, quantity);
 }