Ejemplo n.º 1
0
 private void AddMassInternal(Sim.ConsumedMassInfo consumed_info)
 {
     if (consumed_info.mass > 0f)
     {
         if (storeOnConsume)
         {
             Element element = ElementLoader.elements[consumed_info.removedElemIdx];
             if (elementToConsume == SimHashes.Vacuum || elementToConsume == element.id)
             {
                 if (element.IsLiquid)
                 {
                     storage.AddLiquid(element.id, consumed_info.mass, consumed_info.temperature, consumed_info.diseaseIdx, consumed_info.diseaseCount, true, true);
                 }
                 else if (element.IsGas)
                 {
                     storage.AddGasChunk(element.id, consumed_info.mass, consumed_info.temperature, consumed_info.diseaseIdx, consumed_info.diseaseCount, true, true);
                 }
             }
         }
         else
         {
             consumedTemperature = GameUtil.GetFinalTemperature(consumed_info.temperature, consumed_info.mass, consumedTemperature, consumedMass);
             consumedMass       += consumed_info.mass;
         }
     }
     Game.Instance.accumulators.Accumulate(accumulator, consumed_info.mass);
 }
Ejemplo n.º 2
0
 public static void AddMass(Sim.ConsumedMassInfo consumed_info)
 {
     if (Sim.IsValidHandle(consumed_info.simHandle) && handleInstanceMap.TryGetValue(consumed_info.simHandle, out ElementConsumer value))
     {
         value.AddMassInternal(consumed_info);
     }
 }