示例#1
0
    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);
        }
    }
示例#2
0
 private void AddOrIncrementVolume(Dictionary <Matter, int> dictionary, Matter key, float addition)
 {
     AddOrIncrement <Matter>(dictionary, key, Mathf.CeilToInt(addition * key.CubicMetersPerUnit()));
 }
示例#3
0
 internal void Eat(Matter mealType)
 {
     Data.MatterHistory.Consume(mealType, Get(mealType).Pull(mealType.CubicMetersPerUnit()));
     SurvivalTimer.Instance.EatFood(mealType);
     OnResourceChange(mealType);
 }