public bool raiseCost(EnemyUnit unit, float amount) { Debug.Log("Raising the price of " + unit.name + " by " + amount); if (table.ContainsKey(unit.name)) { CreditTableEntry target = new CreditTableEntry(unit); table.TryGetValue(unit.name, out target); target.alterCost(amount); return(true); } return(false); }
public bool cheapen(EnemyUnit unit, float amount) { if (table.ContainsKey(unit.name)) { CreditTableEntry target = new CreditTableEntry(unit); table.TryGetValue(unit.name, out target); target.alterCost(-amount); Debug.Log("Reducing the price of " + unit.name + " by " + amount + " it now costs " + lookUp(unit.name)); return(true); } return(false); }