コード例 #1
0
        public MovementComplexity GetLastManeuverColor()
        {
            MovementComplexity result = MovementComplexity.None;

            result = AssignedManeuver.ColorComplexity;
            return(result);
        }
コード例 #2
0
        public AfterManeuver(
            ManeuverSpeed minSpeed              = ManeuverSpeed.Speed0,
            ManeuverSpeed maxSpeed              = ManeuverSpeed.Speed5,
            MovementComplexity complexity       = MovementComplexity.None,
            bool onlyIfFullyExecuted            = false,
            bool onlyIfPartialExecuted          = false,
            bool onlyIfMovedThroughFriendlyShip = false,
            ManeuverBearing onlyIfBearing       = ManeuverBearing.None,
            Type hasToken = null
            )
        {
            ManeuverHolder minSpeedHolder = new ManeuverHolder()
            {
                Speed = minSpeed
            };

            MinSpeed = minSpeedHolder.SpeedIntSigned;

            ManeuverHolder maxSpeedHolder = new ManeuverHolder()
            {
                Speed = maxSpeed
            };

            MaxSpeed                       = maxSpeedHolder.SpeedIntSigned;
            Complexity                     = complexity;
            OnlyIfFullyExecuted            = onlyIfFullyExecuted;
            OnlyIfPartialExecuted          = onlyIfPartialExecuted;
            OnlyIfMovedThroughFriendlyShip = onlyIfMovedThroughFriendlyShip;
            OnlyIfBearing                  = onlyIfBearing;
            HasToken                       = hasToken;
        }
コード例 #3
0
    private Color ColorFromComplexity(MovementComplexity complexity)
    {
        Color result = new Color();

        switch (complexity)
        {
        case MovementComplexity.Easy:
            result = Editions.Edition.Current.MovementEasyColor;
            break;

        case MovementComplexity.Normal:
            result = Color.white;
            break;

        case MovementComplexity.Complex:
            result = Color.red;
            break;

        case MovementComplexity.Purple:
            result = new Color(0.5f, 0, 0.5f);
            break;

        default:
            break;
        }

        return(result);
    }
コード例 #4
0
        private void AskChangeManeuver(object sender, System.EventArgs e)
        {
            Messages.ShowInfoToHuman("Juno Eclipse: You can increase or decrease your maneuver speed");
            allowedMovements.Clear();
            string key   = HostShip.AssignedManeuver.ToString();
            int    speed = HostShip.AssignedManeuver.Speed;

            allowedMovements.Add(key);

            //Generate key for maneuvre + 1. If exist backups old color, and change to actual
            keyPlus   = key.Replace(speed.ToString()[0], (speed + 1).ToString()[0]);
            plusColor = MovementComplexity.None;
            if (HostShip.Maneuvers.ContainsKey(keyPlus))
            {
                allowedMovements.Add(keyPlus);
                plusColor = HostShip.Maneuvers[keyPlus];
                HostShip.Maneuvers[keyPlus] = HostShip.AssignedManeuver.ColorComplexity;
            }

            //Generate key for maneuvre - 1. If exist backups old color, and change to actual
            keyMinus   = key.Replace(speed.ToString()[0], (speed - 1).ToString()[0]);
            minusColor = MovementComplexity.None;
            if (HostShip.Maneuvers.ContainsKey(keyMinus))
            {
                allowedMovements.Add(keyMinus);
                minusColor = HostShip.Maneuvers[keyMinus];
                HostShip.Maneuvers[keyMinus] = HostShip.AssignedManeuver.ColorComplexity;
            }

            HostShip.Owner.ChangeManeuver((maneuverCode) => {
                GameMode.CurrentGameMode.AssignManeuver(maneuverCode);
                HostShip.OnMovementFinish += RestoreManuvers;
            }, StraightOrKoiogran);
        }
コード例 #5
0
 public GenericMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color)
 {
     Speed           = speed;
     ManeuverSpeed   = GetManeuverSpeed(speed);
     Direction       = direction;
     Bearing         = bearing;
     ColorComplexity = color;
 }
コード例 #6
0
ファイル: ManeuverHolder.cs プロジェクト: qbasicjed/FlyCasual
        public ManeuverHolder(ManeuverSpeed speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity complexity = MovementComplexity.None)
        {
            Speed           = speed;
            Direction       = direction;
            Bearing         = bearing;
            ColorComplexity = complexity;

            shipTag = null;
        }
コード例 #7
0
ファイル: CountessRyad.cs プロジェクト: jychuah/FlyCasual
 protected void AskChangeManeuver(object sender, System.EventArgs e)
 {
     Messages.ShowInfoToHuman("Countess Ryad: You can change your maneuver to Koiogran turn");
     maneuverKey   = HostShip.AssignedManeuver.Speed + ".F.R";
     originalColor = (HostShip.Maneuvers.ContainsKey(maneuverKey)) ? HostShip.Maneuvers[maneuverKey] : MovementComplexity.None;
     HostShip.Maneuvers[maneuverKey] = GetNewManeuverComplexity();
     HostShip.Owner.ChangeManeuver((maneuverCode) => {
         GameMode.CurrentGameMode.AssignManeuver(maneuverCode);
         HostShip.OnMovementFinish += RestoreManuvers;
     }, StraightOrKoiogran);
 }
コード例 #8
0
        public void UpdateColorComplexity()
        {
            string parameters = this.ToString();

            Ship.GenericShip ship = Roster.GetShipById(shipTag) ?? Selection.ThisShip;
            if (!ship.Maneuvers.ContainsKey(parameters))
            {
                Console.Write(ship.Type + " doesn't have " + parameters + " maneuver!", LogTypes.Errors, true, "red");
            }
            else
            {
                ColorComplexity = ship.Maneuvers[parameters];
                ColorComplexity = ship.GetColorComplexityOfManeuver(this);
            }
        }
コード例 #9
0
ファイル: GenericMovement.cs プロジェクト: marcne/FlyCasual
        public static MovementComplexity ReduceComplexity(MovementComplexity complexity)
        {
            switch (complexity)
            {
            case MovementComplexity.Normal:
                complexity = MovementComplexity.Easy;
                break;

            case MovementComplexity.Complex:
                complexity = MovementComplexity.Normal;
                break;
            }

            return(complexity);
        }
コード例 #10
0
        public void UpdateColorComplexity()
        {
            string parameters = this.ToString();

            Ship.GenericShip ship = Roster.GetShipById(shipTag) ?? Selection.ThisShip;
            if (!ship.Maneuvers.ContainsKey(parameters))
            {
                //
            }
            else
            {
                ColorComplexity = ship.Maneuvers[parameters];
                ColorComplexity = ship.GetColorComplexityOfManeuver(this);
            }
        }
コード例 #11
0
 public KoiogranTurnMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }
コード例 #12
0
        public ManeuverHolder(string parameters, Ship.GenericShip ship = null)
        {
            string[] arrParameters = parameters.Split('.');
            if (arrParameters.Length < 3)
            {
                Messages.ShowError($"Error: maneuverCode is invalid, only {arrParameters.Length} blocks. String: \"{parameters}\"");
            }

            ManeuverSpeed speed = ManeuverSpeed.Speed1;

            switch (arrParameters[0])
            {
            case "0":
                speed = ManeuverSpeed.Speed0;
                break;

            case "1":
                speed = ManeuverSpeed.Speed1;
                break;

            case "2":
                speed = ManeuverSpeed.Speed2;
                break;

            case "3":
                speed = ManeuverSpeed.Speed3;
                break;

            case "4":
                speed = ManeuverSpeed.Speed4;
                break;

            case "5":
                speed = ManeuverSpeed.Speed5;
                break;

            default:
                Messages.ShowError($"Error: Speed in maneuverCode is invalid, \"{arrParameters[0]}\"");
                break;
            }

            ManeuverDirection direction = ManeuverDirection.Forward;

            switch (arrParameters[1])
            {
            case "F":
                direction = ManeuverDirection.Forward;
                break;

            case "L":
                direction = ManeuverDirection.Left;
                break;

            case "R":
                direction = ManeuverDirection.Right;
                break;

            case "S":
                direction = ManeuverDirection.Stationary;
                break;

            default:
                Messages.ShowError($"Error: Direction in maneuverCode is invalid, \"{arrParameters[1]}\"");
                break;
            }

            ManeuverBearing bearing = ManeuverBearing.Straight;

            switch (arrParameters[2])
            {
            case "S":
                bearing = (speed != ManeuverSpeed.Speed0) ? ManeuverBearing.Straight : ManeuverBearing.Stationary;
                break;

            case "R":
                bearing = (direction == ManeuverDirection.Forward) ? ManeuverBearing.KoiogranTurn : ManeuverBearing.SegnorsLoop;
                break;

            case "r":
                bearing = ManeuverBearing.SegnorsLoopUsingTurnTemplate;
                break;

            case "E":
                bearing = ManeuverBearing.TallonRoll;
                break;

            case "B":
                bearing = ManeuverBearing.Bank;
                break;

            case "b":
                bearing = ManeuverBearing.SideslipBank;
                break;

            case "T":
                bearing = ManeuverBearing.Turn;
                break;

            case "t":
                bearing = ManeuverBearing.SideslipTurn;
                break;

            case "V":
                bearing = ManeuverBearing.ReverseStraight;
                break;

            default:
                Messages.ShowError($"Error: Bearing in maneuverCode is invalid, \"{arrParameters[2]}\"");
                break;
            }

            Speed     = speed;
            Direction = direction;
            Bearing   = bearing;

            ship    = ship ?? Selection.ThisShip;
            shipTag = ship.GetTag();

            if (!ship.Maneuvers.ContainsKey(parameters))
            {
                //
            }
            ColorComplexity = ship.Maneuvers[parameters];
            ColorComplexity = ship.GetColorComplexityOfManeuver(this);
        }
コード例 #13
0
ファイル: StraightBoost.cs プロジェクト: xNyer/FlyCasual
 public StraightBoost(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }
コード例 #14
0
        public MovementStruct(string parameters, Ship.GenericShip ship = null)
        {
            string[] arrParameters = parameters.Split('.');

            ManeuverSpeed speed = ManeuverSpeed.Speed1;

            switch (arrParameters[0])
            {
            case "0":
                speed = ManeuverSpeed.Speed0;
                break;

            case "1":
                speed = ManeuverSpeed.Speed1;
                break;

            case "2":
                speed = ManeuverSpeed.Speed2;
                break;

            case "3":
                speed = ManeuverSpeed.Speed3;
                break;

            case "4":
                speed = ManeuverSpeed.Speed4;
                break;

            case "5":
                speed = ManeuverSpeed.Speed5;
                break;
            }

            ManeuverDirection direction = ManeuverDirection.Forward;

            switch (arrParameters[1])
            {
            case "F":
                direction = ManeuverDirection.Forward;
                break;

            case "L":
                direction = ManeuverDirection.Left;
                break;

            case "R":
                direction = ManeuverDirection.Right;
                break;

            case "S":
                direction = ManeuverDirection.Stationary;
                break;
            }

            ManeuverBearing bearing = ManeuverBearing.Straight;

            switch (arrParameters[2])
            {
            case "S":
                bearing = (speed != ManeuverSpeed.Speed0) ? ManeuverBearing.Straight : ManeuverBearing.Stationary;
                break;

            case "R":
                bearing = (direction == ManeuverDirection.Forward) ? ManeuverBearing.KoiogranTurn : ManeuverBearing.SegnorsLoop;
                break;

            case "E":
                bearing = ManeuverBearing.TallonRoll;
                break;

            case "B":
                bearing = ManeuverBearing.Bank;
                break;

            case "T":
                bearing = ManeuverBearing.Turn;
                break;
            }

            Speed     = speed;
            Direction = direction;
            Bearing   = bearing;

            ship    = ship ?? Selection.ThisShip;
            shipTag = ship.GetTag();

            if (!ship.Maneuvers.ContainsKey(parameters))
            {
                Console.Write("<b>Ship " + ship.Type + " doesn't have maneuver " + parameters + "</b>", LogTypes.Errors, true, "red");
            }
            ColorComplexity = ship.Maneuvers[parameters];
            ColorComplexity = ship.GetColorComplexityOfManeuver(this);
        }
コード例 #15
0
ファイル: ShipDialInfo.cs プロジェクト: vitreuz/FlyCasual
 public void AddManeuver(ManeuverHolder maneuver, MovementComplexity complexity)
 {
     PrintedDial.Add(maneuver, complexity);
 }
コード例 #16
0
ファイル: ShipDialInfo.cs プロジェクト: vitreuz/FlyCasual
        public void ChangeManeuverComplexity(ManeuverHolder maneuver, MovementComplexity complexity)
        {
            ManeuverHolder match = PrintedDial.First(m => m.Key.Speed == maneuver.Speed && m.Key.Direction == maneuver.Direction && m.Key.Bearing == maneuver.Bearing).Key;

            PrintedDial[match] = complexity;
        }
コード例 #17
0
ファイル: ShipDialInfo.cs プロジェクト: vitreuz/FlyCasual
 public ManeuverInfo(ManeuverSpeed speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity complexity)
 {
     Movement   = new ManeuverHolder(speed, direction, bearing);
     Complexity = complexity;
 }
コード例 #18
0
ファイル: TallonRollMovement.cs プロジェクト: xNyer/FlyCasual
 public TallonRollMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }
コード例 #19
0
 public SegnorsLoopMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
     RotationEndDegrees = 180;
 }
コード例 #20
0
 public TallonRollMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
     RotationEndDegrees = (direction == ManeuverDirection.Left) ? -90 : 90;
 }
コード例 #21
0
 public ReverseBankMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }
コード例 #22
0
 public SegnorsLoopUsingTurnTemplateMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color)
 {
 }