public MovementComplexity GetLastManeuverColor() { MovementComplexity result = MovementComplexity.None; result = AssignedManeuver.ColorComplexity; return(result); }
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; }
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); }
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); }
public GenericMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) { Speed = speed; ManeuverSpeed = GetManeuverSpeed(speed); Direction = direction; Bearing = bearing; ColorComplexity = color; }
public ManeuverHolder(ManeuverSpeed speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity complexity = MovementComplexity.None) { Speed = speed; Direction = direction; Bearing = bearing; ColorComplexity = complexity; shipTag = null; }
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); }
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); } }
public static MovementComplexity ReduceComplexity(MovementComplexity complexity) { switch (complexity) { case MovementComplexity.Normal: complexity = MovementComplexity.Easy; break; case MovementComplexity.Complex: complexity = MovementComplexity.Normal; break; } return(complexity); }
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); } }
public KoiogranTurnMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color) { }
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); }
public StraightBoost(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color) { }
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); }
public void AddManeuver(ManeuverHolder maneuver, MovementComplexity complexity) { PrintedDial.Add(maneuver, complexity); }
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; }
public ManeuverInfo(ManeuverSpeed speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity complexity) { Movement = new ManeuverHolder(speed, direction, bearing); Complexity = complexity; }
public TallonRollMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color) { }
public SegnorsLoopMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color) { RotationEndDegrees = 180; }
public TallonRollMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color) { RotationEndDegrees = (direction == ManeuverDirection.Left) ? -90 : 90; }
public ReverseBankMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color) { }
public SegnorsLoopUsingTurnTemplateMovement(int speed, ManeuverDirection direction, ManeuverBearing bearing, MovementComplexity color) : base(speed, direction, bearing, color) { }