private void ConvertMealMatter(Matter from, Matter to) { if (Data.Containers[from].CurrentAmount >= from.CubicMetersPerUnit() && Data.Containers[to].AvailableCapacity >= to.CubicMetersPerUnit()) { Data.MatterHistory.Consume(from, Data.Containers[from].Pull(from.CubicMetersPerUnit())); Data.MatterHistory.Produce(to, Data.Containers[to].Push(to.CubicMetersPerUnit())); OnResourceChange(from, to); } }
private void AddOrIncrementVolume(Dictionary <Matter, int> dictionary, Matter key, float addition) { AddOrIncrement <Matter>(dictionary, key, Mathf.CeilToInt(addition * key.CubicMetersPerUnit())); }
internal void Eat(Matter mealType) { Data.MatterHistory.Consume(mealType, Get(mealType).Pull(mealType.CubicMetersPerUnit())); SurvivalTimer.Instance.EatFood(mealType); OnResourceChange(mealType); }