private void Consume(ResourceHolder.ResType resType, float amount = 1f) { var satisfiying = ResourceHolder.ConsumeAllLeft(resType, amount); if (satisfiying) { var currentLevel = satisfaction[resType]; if (currentLevel == SatisfactionLevel.FULL) { return; } satisfaction[resType] = currentLevel + 1; } else { var currentLevel = satisfaction[resType]; if (currentLevel == SatisfactionLevel.NONE) { return; } satisfaction[resType] = currentLevel - 1; } }
public ResAmount(ResourceHolder.ResType resType, float amount) { this.resType = resType; this.amount = amount; }