コード例 #1
0
    /// <summary>
    /// Gets the temperature.
    /// </summary>
    /// <returns>The temperature.</returns>
    public float GetTemperature()
    {
        float t = TotalGas.IsZero() ? 0.0f : ThermalEnergy / TotalGas;

        if (float.IsNaN(t))
        {
            UnityDebugger.Debugger.Log("Atmosphere", "NaN result. Total gas = " + TotalGas + ". Energy = " + ThermalEnergy + ".");
        }

        return(TotalGas.IsZero() ? 0.0f : ThermalEnergy / TotalGas);
    }
コード例 #2
0
 /// <summary>
 /// Gets the temperature value for this room.
 /// </summary>
 /// <returns> The temperature value as <see cref="TemperatureValue"/>. </returns>
 public TemperatureValue GetTemperature()
 {
     return(TotalGas.IsZero() ? TemperatureValue.AbsoluteZero : internalTemperature);
 }