public void UpdateStoredGasLevel(ref MyDefinitionId gasId, float fillLevel)
        {
            int gasIndex = -1;

            if (!TryGetTypeIndex(ref gasId, out gasIndex))
            {
                return;
            }

            m_storedGases[gasIndex].FillLevel = fillLevel;
            CharacterGasSource.SetRemainingCapacityByType(gasId, fillLevel * m_storedGases[gasIndex].MaxCapacity);
            CharacterGasSource.SetProductionEnabledByType(gasId, fillLevel > 0);
        }
        private void TransferSuitGas(ref MyDefinitionId gasId, float gasInput, float gasOutput)
        {
            int gasIndex = GetTypeIndex(ref gasId);

            float gasTransfer = gasInput - gasOutput;

            if (MySession.Static.CreativeMode)
            {
                gasTransfer = Math.Max(gasTransfer, 0f);
            }

            if (gasTransfer == 0f)
            {
                return;
            }

            var gasInfo = m_storedGases[gasIndex];

            gasInfo.FillLevel = MathHelper.Clamp(gasInfo.FillLevel + gasTransfer / gasInfo.MaxCapacity, 0f, 1f);
            CharacterGasSource.SetRemainingCapacityByType(gasInfo.Id, gasInfo.FillLevel * gasInfo.MaxCapacity);
            CharacterGasSource.SetProductionEnabledByType(gasInfo.Id, gasInfo.FillLevel > 0);
        }