Пример #1
0
    public static GenericMovement MovementFromStruct(ManeuverHolder movementStruct)
    {
        GenericMovement result = null;

        if (movementStruct.Bearing == ManeuverBearing.Straight)
        {
            result = new StraightMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.KoiogranTurn)
        {
            result = new KoiogranTurnMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.Turn)
        {
            result = new TurnMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.Bank)
        {
            result = new BankMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.SegnorsLoop)
        {
            result = new SegnorsLoopMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.SegnorsLoopUsingTurnTemplate)
        {
            result = new SegnorsLoopUsingTurnTemplateMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.TallonRoll)
        {
            result = new TallonRollMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.Stationary)
        {
            result = new StationaryMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.SideslipBank)
        {
            result = new SideslipBankMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.SideslipTurn)
        {
            result = new SideslipTurnMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
        }
        else if (movementStruct.Bearing == ManeuverBearing.ReverseStraight)
        {
            if (movementStruct.Direction == ManeuverDirection.Forward)
            {
                result = new ReverseStraightMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
            }
            else
            {
                result = new ReverseBankMovement(movementStruct.SpeedIntUnsigned, movementStruct.Direction, movementStruct.Bearing, movementStruct.ColorComplexity);
            }
        }

        return(result);
    }
Пример #2
0
        private void UseInertialDampenersAbility(object sender, System.EventArgs e)
        {
            DecisionSubPhase.ConfirmDecisionNoCallback();
            GenericMovement movement = new StationaryMovement(0, ManeuverDirection.Stationary, ManeuverBearing.Stationary, MovementComplexity.Normal);
            HostShip.SetAssignedManeuver(movement);
            HostShip.OnMovementFinish += RegisterAssignStressAfterManeuver;

            FinishAbility();
        }