Run spell check over solution

This commit is contained in:
RoosterDragon
2021-12-05 16:22:22 +00:00
committed by reaperrr
parent b3d290edd9
commit 727084c5fc
31 changed files with 34 additions and 34 deletions

View File

@@ -107,7 +107,7 @@ namespace OpenRA
// - the triangles ACD and BCD must have opposite sense (clockwise or anticlockwise) // - the triangles ACD and BCD must have opposite sense (clockwise or anticlockwise)
// - the triangles CAB and DAB must have opposite sense // - the triangles CAB and DAB must have opposite sense
// Segments intersect if the orientation (clockwise or anticlockwise) of the two points in each line segment are opposite with respect to the other // Segments intersect if the orientation (clockwise or anticlockwise) of the two points in each line segment are opposite with respect to the other
// Assumes that lines are not colinear // Assumes that lines are not collinear
return WindingDirectionTest(c, d, a) != WindingDirectionTest(c, d, b) && WindingDirectionTest(a, b, c) != WindingDirectionTest(a, b, d); return WindingDirectionTest(c, d, a) != WindingDirectionTest(c, d, b) && WindingDirectionTest(a, b, c) != WindingDirectionTest(a, b, d);
} }

View File

@@ -238,7 +238,7 @@ namespace OpenRA.Graphics
if (unlockMinZoom) if (unlockMinZoom)
{ {
// Specators and the map editor support zooming out by an extra factor of two. // Spectators and the map editor support zooming out by an extra factor of two.
// TODO: Allow zooming out until the full map is visible // TODO: Allow zooming out until the full map is visible
// We need to improve our viewport scroll handling to center the map as we zoom out // We need to improve our viewport scroll handling to center the map as we zoom out
// before this will work well enough to enable // before this will work well enough to enable

View File

@@ -68,7 +68,7 @@ namespace OpenRA
try try
{ {
// HACK: If the path is inside the the support directory then we may need to create it // HACK: If the path is inside the support directory then we may need to create it
// Assume that the path is a directory if there is not an existing file with the same name // Assume that the path is a directory if there is not an existing file with the same name
var resolved = Platform.ResolvePath(name); var resolved = Platform.ResolvePath(name);
if (resolved.StartsWith(Platform.SupportDir) && !File.Exists(resolved)) if (resolved.StartsWith(Platform.SupportDir) && !File.Exists(resolved))

View File

@@ -72,7 +72,7 @@ namespace OpenRA
else else
Polygons = new[] { Corners }; Polygons = new[] { Corners };
// Initial value must be asigned before HeightOffset can be called // Initial value must be assigned before HeightOffset can be called
CenterHeightOffset = 0; CenterHeightOffset = 0;
CenterHeightOffset = HeightOffset(0, 0); CenterHeightOffset = HeightOffset(0, 0);
} }

View File

@@ -91,7 +91,7 @@ namespace OpenRA.Primitives
public static long Mask => allBits; public static long Mask => allBits;
} }
// Opitmized BitSet to be used only when guaranteed to be no more than 64 values. // Optimized BitSet to be used only when guaranteed to be no more than 64 values.
public readonly struct LongBitSet<T> : IEnumerable<string>, IEquatable<LongBitSet<T>> where T : class public readonly struct LongBitSet<T> : IEnumerable<string>, IEquatable<LongBitSet<T>> where T : class
{ {
readonly long bits; readonly long bits;

View File

@@ -118,7 +118,7 @@ namespace OpenRA
[Desc("Display a graph with various profiling traces")] [Desc("Display a graph with various profiling traces")]
public bool PerfGraph = false; public bool PerfGraph = false;
[Desc("Numer of samples to average over when calculating tick and render times.")] [Desc("Number of samples to average over when calculating tick and render times.")]
public int Samples = 25; public int Samples = 25;
[Desc("Check whether a newer version is available online.")] [Desc("Check whether a newer version is available online.")]

View File

@@ -625,7 +625,7 @@ namespace OpenRA.Support
if (lastToken.Opens != Grouping.None && token.Closes != Grouping.None) if (lastToken.Opens != Grouping.None && token.Closes != Grouping.None)
throw new InvalidDataException($"Empty parenthesis at index {lastToken.Index}"); throw new InvalidDataException($"Empty parenthesis at index {lastToken.Index}");
// Exactly one of two consective tokens must take the other's sub-expression evaluation as an operand // Exactly one of two consecutive tokens must take the other's sub-expression evaluation as an operand
if (lastToken.RightOperand == token.LeftOperand) if (lastToken.RightOperand == token.LeftOperand)
{ {
if (lastToken.RightOperand) if (lastToken.RightOperand)

View File

@@ -95,7 +95,7 @@ namespace OpenRA
{ {
if (args.Length % 2 != 0) if (args.Length % 2 != 0)
throw new ArgumentException("Expected a comma separated list of name, value arguments" throw new ArgumentException("Expected a comma separated list of name, value arguments"
+ "but the number of arguments is not a multiple of two", nameof(args)); + " but the number of arguments is not a multiple of two", nameof(args));
var argumentDictionary = new Dictionary<string, object> { { name, value } }; var argumentDictionary = new Dictionary<string, object> { { name, value } };

View File

@@ -62,7 +62,7 @@ namespace OpenRA.Mods.Cnc.Traits
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>); public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
[CursorReference] [CursorReference]
[Desc("Cursor to display when targetting.")] [Desc("Cursor to display when targeting.")]
public readonly string AttackCursor = "attack"; public readonly string AttackCursor = "attack";
[CursorReference] [CursorReference]

View File

@@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.Activities
var isLanded = dat <= aircraft.LandAltitude; var isLanded = dat <= aircraft.LandAltitude;
// HACK: Prevent paused (for example, EMP'd) aircraft from taking off. // HACK: Prevent paused (for example, EMP'd) aircraft from taking off.
// This is necessary until the TODOs in the IsCanceling block below are adressed. // This is necessary until the TODOs in the IsCanceling block below are addressed.
if (isLanded && aircraft.IsTraitPaused) if (isLanded && aircraft.IsTraitPaused)
return false; return false;
@@ -236,7 +236,7 @@ namespace OpenRA.Mods.Common.Activities
if (!isSlider) if (!isSlider)
{ {
// Using the turn rate, compute a hypothetical circle traced by a continuous turn. // Using the turn rate, compute a hypothetical circle traced by a continuous turn.
// If it contains the destination point, it's unreachable without more complex manuvering. // If it contains the destination point, it's unreachable without more complex maneuvering.
var turnRadius = CalculateTurnRadius(aircraft.MovementSpeed, aircraft.TurnSpeed); var turnRadius = CalculateTurnRadius(aircraft.MovementSpeed, aircraft.TurnSpeed);
// The current facing is a tangent of the minimal turn circle. // The current facing is a tangent of the minimal turn circle.

View File

@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Activities
/// <summary> /// <summary>
/// Called when the actor has entered the target actor. /// Called when the actor has entered the target actor.
/// Actor will be be Killed/Disposed or they will enter/exit unharmed. /// Actor will be Killed/Disposed or they will enter/exit unharmed.
/// Depends on either the EnterBehaviour of the actor or the requirements of an overriding function. /// Depends on either the EnterBehaviour of the actor or the requirements of an overriding function.
/// </summary> /// </summary>
protected virtual void OnEnterComplete(Actor self, Actor targetActor) { } protected virtual void OnEnterComplete(Actor self, Actor targetActor) { }

View File

@@ -193,7 +193,7 @@ namespace OpenRA.Mods.Common.Activities
return PathGraph.PathCostForInvalidPath; return PathGraph.PathCostForInvalidPath;
// Add a cost modifier to harvestable cells to prefer resources that are closer to the refinery. // Add a cost modifier to harvestable cells to prefer resources that are closer to the refinery.
// This reduces the tendancy for harvesters to move in straight lines // This reduces the tendency for harvesters to move in straight lines
if (procPos.HasValue && harvInfo.ResourceRefineryDirectionPenalty > 0 && harv.CanHarvestCell(self, loc)) if (procPos.HasValue && harvInfo.ResourceRefineryDirectionPenalty > 0 && harv.CanHarvestCell(self, loc))
{ {
var pos = map.CenterOfCell(loc); var pos = map.CenterOfCell(loc);

View File

@@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Activities
// HACK: If the activity is cancelled while we're on the host resupplying (or about to start resupplying), // HACK: If the activity is cancelled while we're on the host resupplying (or about to start resupplying),
// move actor outside the resupplier footprint to prevent it from blocking other actors. // move actor outside the resupplier footprint to prevent it from blocking other actors.
// Additionally, if the host is no longer valid, make aircaft take off. // Additionally, if the host is no longer valid, make aircraft take off.
if (isCloseEnough || isHostInvalid) if (isCloseEnough || isHostInvalid)
OnResupplyEnding(self, isHostInvalid); OnResupplyEnding(self, isHostInvalid);

View File

@@ -79,7 +79,7 @@ namespace OpenRA.Mods.Common.Projectiles
[Desc("Controls the way inaccuracy is calculated. Possible values are 'Maximum' - scale from 0 to max with range, 'PerCellIncrement' - scale from 0 with range and 'Absolute' - use set value regardless of range.")] [Desc("Controls the way inaccuracy is calculated. Possible values are 'Maximum' - scale from 0 to max with range, 'PerCellIncrement' - scale from 0 with range and 'Absolute' - use set value regardless of range.")]
public readonly InaccuracyType InaccuracyType = InaccuracyType.Absolute; public readonly InaccuracyType InaccuracyType = InaccuracyType.Absolute;
[Desc("Inaccuracy override when sucessfully locked onto target. Defaults to Inaccuracy if negative.")] [Desc("Inaccuracy override when successfully locked onto target. Defaults to Inaccuracy if negative.")]
public readonly WDist LockOnInaccuracy = new WDist(-1); public readonly WDist LockOnInaccuracy = new WDist(-1);
[Desc("Probability of locking onto and following target.")] [Desc("Probability of locking onto and following target.")]
@@ -546,7 +546,7 @@ namespace OpenRA.Mods.Common.Projectiles
// Attained height after ascent as predicted from upper part of incline surmounting manoeuvre // Attained height after ascent as predicted from upper part of incline surmounting manoeuvre
var predAttHght = loopRadius * (1024 - WAngle.FromFacing(vFacing).Cos()) / 1024 - diffClfMslHgt; var predAttHght = loopRadius * (1024 - WAngle.FromFacing(vFacing).Cos()) / 1024 - diffClfMslHgt;
// Should the missile be slowed down in order to make it more manoeuverable // Should the missile be slowed down in order to make it more maneuverable
var slowDown = info.Acceleration.Length != 0 // Possible to decelerate var slowDown = info.Acceleration.Length != 0 // Possible to decelerate
&& ((desiredVFacing != 0 // Lower part of incline surmounting manoeuvre && ((desiredVFacing != 0 // Lower part of incline surmounting manoeuvre

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Scripting
} }
[ScriptActorPropertyActivity] [ScriptActorPropertyActivity]
[Desc("Queues a landing activity on the specififed actor.")] [Desc("Queues a landing activity on the specified actor.")]
public void Land(Actor landOn) public void Land(Actor landOn)
{ {
Self.QueueActivity(new Land(Self, Target.FromActor(landOn))); Self.QueueActivity(new Land(Self, Target.FromActor(landOn)));

View File

@@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders
} }
else if (png.EmbeddedData.ContainsKey("FrameAmount")) else if (png.EmbeddedData.ContainsKey("FrameAmount"))
{ {
// Otherwise, calculate the number of frames by splitting the image horizontaly by FrameAmount. // Otherwise, calculate the number of frames by splitting the image horizontally by FrameAmount.
frameAmount = FieldLoader.GetValue<int>("FrameAmount", png.EmbeddedData["FrameAmount"]); frameAmount = FieldLoader.GetValue<int>("FrameAmount", png.EmbeddedData["FrameAmount"]);
frameSize = new Size(png.Width / frameAmount, png.Height); frameSize = new Size(png.Width / frameAmount, png.Height);
} }

View File

@@ -156,7 +156,7 @@ namespace OpenRA.Mods.Common.Traits
void INotifyMoving.MovementTypeChanged(Actor self, MovementType type) void INotifyMoving.MovementTypeChanged(Actor self, MovementType type)
{ {
// Recalculate the visiblity at our final stop position // Recalculate the visibility at our final stop position
if (type == MovementType.None && self.IsInWorld) if (type == MovementType.None && self.IsInWorld)
{ {
var centerPosition = self.CenterPosition; var centerPosition = self.CenterPosition;

View File

@@ -78,7 +78,7 @@ namespace OpenRA.Mods.Common.Traits
var br = world.Map.CellContaining(pos + delta); var br = world.Map.CellContaining(pos + delta);
var checkFrozen = firedBy.FrozenActorLayer.FrozenActorsInRegion(new CellRegion(world.Map.Grid.Type, tl, br)); var checkFrozen = firedBy.FrozenActorLayer.FrozenActorsInRegion(new CellRegion(world.Map.Grid.Type, tl, br));
// IsValid check filters out Frozen Actors that have not initizialized their Owner // IsValid check filters out Frozen Actors that have not initialized their Owner
foreach (var scrutinized in checkFrozen) foreach (var scrutinized in checkFrozen)
answer += consideration.GetAttractiveness(scrutinized, firedBy.RelationshipWith(scrutinized.Owner), firedBy); answer += consideration.GetAttractiveness(scrutinized, firedBy.RelationshipWith(scrutinized.Owner), firedBy);
} }

View File

@@ -163,7 +163,7 @@ namespace OpenRA.Mods.Common.Traits
// If the MCV has to move first, we can't be sure it reaches the destination alive, so we only // If the MCV has to move first, we can't be sure it reaches the destination alive, so we only
// update base and defense center if the MCV is deployed immediately (i.e. at game start). // update base and defense center if the MCV is deployed immediately (i.e. at game start).
// TODO: This could be adressed via INotifyTransform. // TODO: This could be addressed via INotifyTransform.
foreach (var n in notifyPositionsUpdated) foreach (var n in notifyPositionsUpdated)
{ {
n.UpdatedBaseCenter(mcv.Location); n.UpdatedBaseCenter(mcv.Location);

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
"Non-positive values will make it use Health.HP.")] "Non-positive values will make it use Health.HP.")]
public readonly int MaxHP = 0; public readonly int MaxHP = 0;
[Desc("Is the condition irrevokable once it has been granted?")] [Desc("Is the condition irrevocable once it has been granted?")]
public readonly bool GrantPermanently = false; public readonly bool GrantPermanently = false;
public override object Create(ActorInitializer init) { return new GrantConditionOnHealth(init.Self, this); } public override object Create(ActorInitializer init) { return new GrantConditionOnHealth(init.Self, this); }

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
[NotificationReference("Sounds")] [NotificationReference("Sounds")]
public readonly string CashTickDownNotification = null; public readonly string CashTickDownNotification = null;
[Desc("Monetery value of each resource type.", "Dictionary of [resource type]: [value per unit].")] [Desc("Monetary value of each resource type.", "Dictionary of [resource type]: [value per unit].")]
public readonly Dictionary<string, int> ResourceValues = new Dictionary<string, int>(); public readonly Dictionary<string, int> ResourceValues = new Dictionary<string, int>();
IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map) IEnumerable<LobbyOption> ILobbyOptions.LobbyOptions(MapPreview map)

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits.Render
[Desc("Number of pips to display how filled unit is.")] [Desc("Number of pips to display how filled unit is.")]
public readonly int PipCount = 0; public readonly int PipCount = 0;
[Desc("If non-zero, override the spacing between adjacing pips.")] [Desc("If non-zero, override the spacing between adjacent pips.")]
public readonly int2 PipStride = int2.Zero; public readonly int2 PipStride = int2.Zero;
[Desc("Image that defines the pip sequences.")] [Desc("Image that defines the pip sequences.")]

View File

@@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly float[] PresetSaturations = { }; public readonly float[] PresetSaturations = { };
[ActorReference] [ActorReference]
[Desc("Actor type to show in the color picker. This can be overriden for specific factions with FactionPreviewActors.")] [Desc("Actor type to show in the color picker. This can be overridden for specific factions with FactionPreviewActors.")]
public readonly string PreviewActor = null; public readonly string PreviewActor = null;
[SequenceReference(dictionaryReference: LintDictionaryReference.Values)] [SequenceReference(dictionaryReference: LintDictionaryReference.Values)]

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
{ {
if (locations.Any()) if (locations.Any())
yield return "[D2k]ResourceRenderer has been added.\n" + yield return "[D2k]ResourceRenderer has been added.\n" +
"You need to adjust the the field RenderTypes on trait [D2k]ResourceRenderer\n" + "You need to adjust the field RenderTypes on trait [D2k]ResourceRenderer\n" +
"on the following actors:\n" + "on the following actors:\n" +
UpdateUtils.FormatMessageList(locations); UpdateUtils.FormatMessageList(locations);

View File

@@ -30,8 +30,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
var message = "TurnToDock is now deprecated. The following actors had TurnToDock enabled:\n" var message = "TurnToDock is now deprecated. The following actors had TurnToDock enabled:\n"
+ UpdateUtils.FormatMessageList(turningAircraft.Select(n => n.Item1 + " (" + n.Item2 + ")")) + UpdateUtils.FormatMessageList(turningAircraft.Select(n => n.Item1 + " (" + n.Item2 + ")"))
+ "\n If you wish these units to keep their turning behaviour when docking with a host building" + + "\n If you wish these units to keep their turning behaviour when docking with a host building" +
"you will need to define a 'Facing' parameter on the 'Exit' trait of the host building. This change" + " you will need to define a 'Facing' parameter on the 'Exit' trait of the host building. This change" +
"does not affect the behaviour for landing on terrain which is governed by TurnToLand."; " does not affect the behaviour for landing on terrain which is governed by TurnToLand.";
if (turningAircraft.Any()) if (turningAircraft.Any())
yield return message; yield return message;

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Warheads
[Desc("Types of damage that this warhead causes. Leave empty for no damage types.")] [Desc("Types of damage that this warhead causes. Leave empty for no damage types.")]
public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>); public readonly BitSet<DamageType> DamageTypes = default(BitSet<DamageType>);
[Desc("Damage percentage versus each armortype.")] [Desc("Damage percentage versus each armor type.")]
public readonly Dictionary<string, int> Versus = new Dictionary<string, int>(); public readonly Dictionary<string, int> Versus = new Dictionary<string, int>();
public override bool IsValidAgainst(Actor victim, Actor firedBy) public override bool IsValidAgainst(Actor victim, Actor firedBy)

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Warheads
[Desc("Type of smudge to apply to terrain.")] [Desc("Type of smudge to apply to terrain.")]
public readonly HashSet<string> SmudgeType = new HashSet<string>(); public readonly HashSet<string> SmudgeType = new HashSet<string>();
[Desc("Percentual chance the smudge is created.")] [Desc("Percentage chance the smudge is created.")]
public readonly int Chance = 100; public readonly int Chance = 100;
public override void DoImpact(in Target target, WarheadArgs args) public override void DoImpact(in Target target, WarheadArgs args)

View File

@@ -208,7 +208,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
title: "Failed to save map", title: "Failed to save map",
text: "See debug.log for details.", text: "See debug.log for details.",
onConfirm: () => { }, onConfirm: () => { },
confirmText: "Ok"); confirmText: "OK");
} }
}; };
} }

View File

@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common
// It falls where t = [(point - target) . (source - target)] / |source - target|^2 // It falls where t = [(point - target) . (source - target)] / |source - target|^2
// The normal DotProduct math would be (xDiff + yDiff) / dist, where dist = (target - source).LengthSquared; // The normal DotProduct math would be (xDiff + yDiff) / dist, where dist = (target - source).LengthSquared;
// But in order to avoid floating points, we do not divide here, but rather work with the large numbers as far as possible. // But in order to avoid floating points, we do not divide here, but rather work with the large numbers as far as possible.
// We then later divide by dist, only AFTER we have multiplied by the dotproduct. // We then later divide by dist, only AFTER we have multiplied by the dot product.
var xDiff = ((long)point.X - lineEnd.X) * (lineStart.X - lineEnd.X); var xDiff = ((long)point.X - lineEnd.X) * (lineStart.X - lineEnd.X);
var yDiff = ((long)point.Y - lineEnd.Y) * (lineStart.Y - lineEnd.Y); var yDiff = ((long)point.Y - lineEnd.Y) * (lineStart.Y - lineEnd.Y);
var t = xDiff + yDiff; var t = xDiff + yDiff;

View File

@@ -272,7 +272,7 @@ Parent: # comment without value
Assert.AreEqual(yaml, result); Assert.AreEqual(yaml, result);
} }
[TestCase(TestName = "Comments should be be removed when discardCommentsAndWhitespace is false")] [TestCase(TestName = "Comments should be removed when discardCommentsAndWhitespace is false")]
public void CommentsShouldntSurviveRoundTrip() public void CommentsShouldntSurviveRoundTrip()
{ {
var yaml = @" var yaml = @"

View File

@@ -354,7 +354,7 @@ namespace OpenRA.Test
AssertParseFailure("t -1", "Missing binary operation before `-1` at index 2"); AssertParseFailure("t -1", "Missing binary operation before `-1` at index 2");
} }
[TestCase(TestName = "Test mixed charaters at end of identifier parser errors")] [TestCase(TestName = "Test mixed characters at end of identifier parser errors")]
public void TestParseMixedEndErrors() public void TestParseMixedEndErrors()
{ {
AssertParseFailure("t- 1", "Invalid identifier end character at index 1 for `t-`"); AssertParseFailure("t- 1", "Invalid identifier end character at index 1 for `t-`");