Exemplo n.º 1
0
        private void ReadThrusterState(MyThrust thruster, out ThrusterMode mode)
        {
            ThrusterBoostInfo boostInfo;

            if (!_boostInfo.TryGetValue(thruster.EntityId, out boostInfo))
            {
                boostInfo = new ThrusterBoostInfo();
            }

            mode = boostInfo.Mode;
        }
Exemplo n.º 2
0
        private void UpdateThruster(MyThrust thruster, bool enableBoost, out float heatLevel, out ThrusterMode mode)
        {
            ThrusterBoostInfo boostInfo;

            if (!_boostInfo.TryGetValue(thruster.EntityId, out boostInfo))
            {
                boostInfo = new ThrusterBoostInfo();
            }

            switch (boostInfo.Mode)
            {
            case ThrusterMode.Boost:
                UpdateThrusterBoostMode(thruster, enableBoost, ref boostInfo);
                break;

            case ThrusterMode.Overheat:
                UpdateThrusterOverheatMode(thruster, enableBoost, ref boostInfo);
                break;

            default:
                UpdateThrusterNormalMode(thruster, enableBoost, ref boostInfo);
                break;
            }

            _boostInfo[thruster.EntityId] = boostInfo;
            heatLevel = boostInfo.CurrentHeatLevel;
            mode      = boostInfo.Mode;
        }