public int GetAmount(RecourceType type) { if (Recources.ContainsKey(type)) { return(Recources[type]); } else { return(0); } }
void changeRecource(RecourceType type, int amount) { if (amount == 0) { return; } if (Recources.ContainsKey(type)) { Recources[type] += amount; } else { Recources.Add(type, amount); } TotalAmountOfGoods += amount; RecourceChanged.Invoke(type, Recources[type], this); RecourcesChanged.Invoke(this); }