Пример #1
0
 /// <summary>
 /// Updates an airlock door's world state.
 /// </summary>
 /// <param name="smi">The door's state machine instance.</param>
 private static void UpdateWorldState(AirlockDoor.Instance smi)
 {
     smi.master.UpdateWorldState();
 }
Пример #2
0
 /// <summary>
 /// Calculates the time in in-game seconds required to vacuum the airlock.
 /// </summary>
 /// <param name="smi">The door's state machine instance.</param>
 /// <returns>The time to spend in the vacuum state.</returns>
 private static float CalculateVacuumTime(AirlockDoor.Instance smi)
 {
     return(Mathf.Lerp(MIN_VACUUM_TIME, MAX_VACUUM_TIME, smi.AveragePressure /
                       PRESSURE_THRESHOLD));
 }
Пример #3
0
 /// <summary>
 /// Calculates the energy required to vacuum the airlock. The energy requirement
 /// can be reduced by as much as 50% if less gas must be removed.
 /// </summary>
 /// <param name="smi">The door's state machine instance.</param>
 /// <returns>The energy to use in the vacuum state.</returns>
 internal static float CalculateVacuumEnergy(AirlockDoor.Instance smi)
 {
     return(Mathf.Lerp(0.5f, 1.0f, smi.AveragePressure /
                       PRESSURE_THRESHOLD) * smi.master.EnergyPerUse);
 }