Fix some spellings.

This commit is contained in:
RoosterDragon
2015-11-27 00:15:09 +00:00
parent 3e8df55bcb
commit bfe1804bf6
56 changed files with 91 additions and 91 deletions

View File

@@ -704,7 +704,7 @@ namespace OpenRA
} }
} }
// mirrors DescriptionAttribute from System.ComponentModel but we dont want to have to use that everywhere. // Mirrors DescriptionAttribute from System.ComponentModel but we don't want to have to use that everywhere.
[AttributeUsage(AttributeTargets.All)] [AttributeUsage(AttributeTargets.All)]
public sealed class DescAttribute : Attribute public sealed class DescAttribute : Attribute
{ {

View File

@@ -65,7 +65,7 @@ namespace OpenRA.FileFormats
var coded = br.ReadBits(8); var coded = br.ReadBits(8);
if (coded < 0 || coded > 1) if (coded < 0 || coded > 1)
throw new NotImplementedException("Invalid datastream"); throw new NotImplementedException("Invalid data stream");
var encodedLiterals = coded == 1; var encodedLiterals = coded == 1;
// log2(dictionary size) - 6 // log2(dictionary size) - 6
@@ -160,7 +160,7 @@ namespace OpenRA.FileFormats
return ms.ToArray(); return ms.ToArray();
} }
// Decode a code using huffman table h. // Decode a code using Huffman table h.
static int Decode(Huffman h, BitReader br) static int Decode(Huffman h, BitReader br)
{ {
var code = 0; // len bits being decoded var code = 0; // len bits being decoded

View File

@@ -111,11 +111,11 @@ namespace OpenRA.FileFormats
/// <summary> /// <summary>
/// A fast (native) CRC32 implementation that can be used on a pinned byte array using /// A fast (native) CRC32 implementation that can be used on a pinned byte array using
/// default polynomal. /// default polynomial.
/// </summary> /// </summary>
/// <param name="data"> [in,out] If non-null, the.</param> /// <param name="data"> [in,out] If non-null, the.</param>
/// <param name="len"> The length of the data data.</param> /// <param name="len"> The length of the data.</param>
/// <param name="polynomial">The polynomal to xor with.</param> /// <param name="polynomial">The polynomial to XOR with.</param>
/// <returns>The calculated checksum.</returns> /// <returns>The calculated checksum.</returns>
public static unsafe uint Calculate(byte* data, uint len, uint polynomial) public static unsafe uint Calculate(byte* data, uint len, uint polynomial)
{ {

View File

@@ -187,7 +187,7 @@ namespace OpenRA.FileFormats
if (bitDepth == 8 && colorType == (PngColorType.Indexed | PngColorType.Color)) if (bitDepth == 8 && colorType == (PngColorType.Indexed | PngColorType.Color))
return PixelFormat.Format8bppIndexed; return PixelFormat.Format8bppIndexed;
throw new InvalidDataException("Unknown pixelformat"); throw new InvalidDataException("Unknown pixel format");
} }
} }
} }

View File

@@ -468,7 +468,7 @@ namespace OpenRA.FileSystem
return GetContentById(fileDes.LinkToPrevious); return GetContentById(fileDes.LinkToPrevious);
if ((fileDes.Flags & FileObfuscated) != 0) if ((fileDes.Flags & FileObfuscated) != 0)
throw new NotImplementedException("Haven't implemented obfustcated files"); throw new NotImplementedException("Haven't implemented obfuscated files");
var output = new MemoryStream((int)fileDes.ExpandedSize); var output = new MemoryStream((int)fileDes.ExpandedSize);
@@ -495,7 +495,7 @@ namespace OpenRA.FileSystem
} }
if ((fileDes.Flags & FileObfuscated) != 0) if ((fileDes.Flags & FileObfuscated) != 0)
throw new NotImplementedException("Haven't implemented obfustcated files"); throw new NotImplementedException("Haven't implemented obfuscated files");
using (var reader = new CabReader(fileDes, index, commonName)) using (var reader = new CabReader(fileDes, index, commonName))
reader.CopyTo(output); reader.CopyTo(output);

View File

@@ -34,7 +34,7 @@ namespace OpenRA.FileSystem
this.priority = priority; this.priority = priority;
try try
{ {
// pull the file into memory, dont keep it open. // Pull the file into memory, don't keep it open.
pkg = new SZipFile(new MemoryStream(File.ReadAllBytes(filename))); pkg = new SZipFile(new MemoryStream(File.ReadAllBytes(filename)));
} }
catch (ZipException e) catch (ZipException e)
@@ -43,7 +43,7 @@ namespace OpenRA.FileSystem
} }
} }
// Create a new zip with the specified contents // Create a new zip with the specified contents.
public ZipFile(string filename, int priority, Dictionary<string, byte[]> contents) public ZipFile(string filename, int priority, Dictionary<string, byte[]> contents)
{ {
this.priority = priority; this.priority = priority;

View File

@@ -412,7 +412,7 @@ namespace OpenRA
public static event Action OnQuit = () => { }; public static event Action OnQuit = () => { };
// Note: These delayed actions should only be used by widgets or disposing objects // Note: These delayed actions should only be used by widgets or disposing objects
// - things that depend on a particular world should be queuing them on the worldactor. // - things that depend on a particular world should be queuing them on the world actor.
static volatile ActionQueue delayedActions = new ActionQueue(); static volatile ActionQueue delayedActions = new ActionQueue();
public static void RunAfterTick(Action a) { delayedActions.Add(a, Game.RunTime); } public static void RunAfterTick(Action a) { delayedActions.Add(a, Game.RunTime); }
public static void RunAfterDelay(int delayMilliseconds, Action a) { delayedActions.Add(a, Game.RunTime + delayMilliseconds); } public static void RunAfterDelay(int delayMilliseconds, Action a) { delayedActions.Add(a, Game.RunTime + delayMilliseconds); }

View File

@@ -25,7 +25,7 @@ namespace OpenRA
/// The actor name can be anything, but the sprites used in the Render*: traits default to this one. /// The actor name can be anything, but the sprites used in the Render*: traits default to this one.
/// If you add an ^ in front of the name, the engine will recognize this as a collection of traits /// If you add an ^ in front of the name, the engine will recognize this as a collection of traits
/// that can be inherited by others (using Inherits:) and not a real unit. /// that can be inherited by others (using Inherits:) and not a real unit.
/// You can remove inherited traits by adding a - infront of them as in -TraitName: to inherit everything, but this trait. /// You can remove inherited traits by adding a - in front of them as in -TraitName: to inherit everything, but this trait.
/// </summary> /// </summary>
public readonly string Name; public readonly string Name;
readonly TypeDictionary traits = new TypeDictionary(); readonly TypeDictionary traits = new TypeDictionary();

View File

@@ -154,7 +154,7 @@ namespace OpenRA.Graphics
screenCorners[j] = new float2(corners[j][0], corners[j][1]); screenCorners[j] = new float2(corners[j][0], corners[j][1]);
} }
// Shadows are rendered at twice the resolution to reduce artefacts // Shadows are rendered at twice the resolution to reduce artifacts
Size spriteSize, shadowSpriteSize; Size spriteSize, shadowSpriteSize;
int2 spriteOffset, shadowSpriteOffset; int2 spriteOffset, shadowSpriteOffset;
CalculateSpriteGeometry(tl, br, 1, out spriteSize, out spriteOffset); CalculateSpriteGeometry(tl, br, 1, out spriteSize, out spriteOffset);

View File

@@ -199,7 +199,7 @@ namespace OpenRA
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.Write("debug", "An exception occured while trying to load mod {0}:", mod); Log.Write("debug", "An exception occurred while trying to load mod {0}:", mod);
Log.Write("debug", ex.ToString()); Log.Write("debug", ex.ToString());
} }
} }

View File

@@ -1222,7 +1222,7 @@ namespace OpenRA
return result; return result;
// If the lengths are equal, use other means to sort them. // If the lengths are equal, use other means to sort them.
// Try the hashcode first because it gives more // Try the hash code first because it gives more
// random-appearing results than X or Y that would always // random-appearing results than X or Y that would always
// prefer the leftmost/topmost position. // prefer the leftmost/topmost position.
result = a.GetHashCode().CompareTo(b.GetHashCode()); result = a.GetHashCode().CompareTo(b.GetHashCode());

View File

@@ -159,7 +159,7 @@ namespace OpenRA
LoadTranslations(map); LoadTranslations(map);
// Reinit all our assets // Reinitialize all our assets
InitializeLoaders(); InitializeLoaders();
GlobalFileSystem.LoadFromManifest(Manifest); GlobalFileSystem.LoadFromManifest(Manifest);

View File

@@ -57,7 +57,7 @@ namespace OpenRA
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine("An exception occured when trying to load ModMetadata for `{0}`:".F(m)); Console.WriteLine("An exception occurred when trying to load ModMetadata for `{0}`:".F(m));
Console.WriteLine(ex.Message); Console.WriteLine(ex.Message);
} }
} }

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Server
{ {
try try
{ {
// NOTE(jsd): Poll the socket first to see if there's anything there. // Poll the socket first to see if there's anything there.
// This avoids the exception with SocketErrorCode == `SocketError.WouldBlock` thrown // This avoids the exception with SocketErrorCode == `SocketError.WouldBlock` thrown
// from `socket.Receive(rx)`. // from `socket.Receive(rx)`.
if (!Socket.Poll(0, SelectMode.SelectRead)) break; if (!Socket.Poll(0, SelectMode.SelectRead)) break;
@@ -64,7 +64,7 @@ namespace OpenRA.Server
} }
catch (SocketException e) catch (SocketException e)
{ {
// NOTE(jsd): This should no longer be needed with the socket.Poll call above. // This should no longer be needed with the socket.Poll call above.
if (e.SocketErrorCode == SocketError.WouldBlock) break; if (e.SocketErrorCode == SocketError.WouldBlock) break;
server.DropClient(this); server.DropClient(this);

View File

@@ -242,7 +242,7 @@ namespace OpenRA.Server
catch (Exception e) catch (Exception e)
{ {
/* TODO: Could have an exception here when listener 'goes away' when calling AcceptConnection! */ /* TODO: Could have an exception here when listener 'goes away' when calling AcceptConnection! */
/* Alternative would be to use locking but the listener doesnt go away without a reason. */ /* Alternative would be to use locking but the listener doesn't go away without a reason. */
Log.Write("server", "Accepting the connection failed.", e); Log.Write("server", "Accepting the connection failed.", e);
return; return;
} }

View File

@@ -48,7 +48,7 @@ namespace OpenRA
public bool NatDeviceAvailable = false; // internal check if discovery succeeded public bool NatDeviceAvailable = false; // internal check if discovery succeeded
[Desc("Time in miliseconds to search for UPnP enabled NAT devices.")] [Desc("Time in milliseconds to search for UPnP enabled NAT devices.")]
public int NatDiscoveryTimeout = 1000; public int NatDiscoveryTimeout = 1000;
[Desc("Print very detailed logs for debugging issues with routers.")] [Desc("Print very detailed logs for debugging issues with routers.")]
@@ -60,7 +60,7 @@ namespace OpenRA
[Desc("Takes a comma separated list of IP addresses that are not allowed to join.")] [Desc("Takes a comma separated list of IP addresses that are not allowed to join.")]
public string[] Ban = { }; public string[] Ban = { };
[Desc("Value in miliseconds when to terminate the game. Needs to be at least 10000 (10 s) to enable the timer.")] [Desc("Value in milliseconds when to terminate the game. Needs to be at least 10000 (10 s) to enable the timer.")]
public int TimeOut = 0; public int TimeOut = 0;
[Desc("Run in headless mode with an empty renderer and without sound output.")] [Desc("Run in headless mode with an empty renderer and without sound output.")]

View File

@@ -65,7 +65,7 @@ namespace OpenRA
{ {
ChannelInfo info; ChannelInfo info;
if (!Channels.TryGetValue(channel, out info)) if (!Channels.TryGetValue(channel, out info))
throw new Exception("Tried logging to non-existant channel " + channel); throw new Exception("Tried logging to non-existent channel " + channel);
if (info.Writer == null) if (info.Writer == null)
return; return;
@@ -77,7 +77,7 @@ namespace OpenRA
{ {
ChannelInfo info; ChannelInfo info;
if (!Channels.TryGetValue(channel, out info)) if (!Channels.TryGetValue(channel, out info))
throw new Exception("Tried logging to non-existant channel " + channel); throw new Exception("Tried logging to non-existent channel " + channel);
if (info.Writer == null) if (info.Writer == null)
return; return;

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Traits
[Desc("This is the internal name for owner checks.")] [Desc("This is the internal name for owner checks.")]
public readonly string InternalName = null; public readonly string InternalName = null;
[Desc("Pick a random faction as the player's facton out of this list.")] [Desc("Pick a random faction as the player's faction out of this list.")]
public readonly HashSet<string> RandomFactionMembers = new HashSet<string>(); public readonly HashSet<string> RandomFactionMembers = new HashSet<string>();
[Desc("The side that the faction belongs to. For example, England belongs to the 'Allies' side.")] [Desc("The side that the faction belongs to. For example, England belongs to the 'Allies' side.")]

View File

@@ -48,7 +48,7 @@ namespace OpenRA
// 1 sample produces a rectangular probability // 1 sample produces a rectangular probability
// 2 samples produces a triangular probability // 2 samples produces a triangular probability
// ... // ...
// N samples approximates a true gaussian // N samples approximates a true Gaussian
public static WDist FromPDF(MersenneTwister r, int samples) public static WDist FromPDF(MersenneTwister r, int samples)
{ {
return new WDist(Exts.MakeArray(samples, _ => r.Next(-1024, 1024)) return new WDist(Exts.MakeArray(samples, _ => r.Next(-1024, 1024))

View File

@@ -70,7 +70,7 @@ namespace OpenRA
// Theoretically 1024 * * 2, but may differ slightly due to rounding // Theoretically 1024 * * 2, but may differ slightly due to rounding
var lsq = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3]; var lsq = q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
// Quarternion components use 10 bits, so there's no risk of overflow // Quaternion components use 10 bits, so there's no risk of overflow
var mtx = new int[16]; var mtx = new int[16];
mtx[0] = lsq - 2 * (q[1] * q[1] + q[2] * q[2]); mtx[0] = lsq - 2 * (q[1] * q[1] + q[2] * q[2]);
mtx[1] = 2 * (q[0] * q[1] + q[2] * q[3]); mtx[1] = 2 * (q[0] * q[1] + q[2] * q[3]);

View File

@@ -78,7 +78,7 @@ namespace OpenRA
// 1 sample produces a rectangular probability // 1 sample produces a rectangular probability
// 2 samples produces a triangular probability // 2 samples produces a triangular probability
// ... // ...
// N samples approximates a true gaussian // N samples approximates a true Gaussian
public static WVec FromPDF(MersenneTwister r, int samples) public static WVec FromPDF(MersenneTwister r, int samples)
{ {
return new WVec(WDist.FromPDF(r, samples), WDist.FromPDF(r, samples), WDist.Zero); return new WVec(WDist.FromPDF(r, samples), WDist.FromPDF(r, samples), WDist.Zero);

View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Activities
this.targetCenter = targetCenter; this.targetCenter = targetCenter;
} }
// CanEnter(target) should to be true; othwise, Enter may abort. // CanEnter(target) should to be true; otherwise, Enter may abort.
// Tries counter starts at 1 (reset every tick) // Tries counter starts at 1 (reset every tick)
protected virtual bool TryGetAlternateTarget(Actor self, int tries, ref Target target) { return false; } protected virtual bool TryGetAlternateTarget(Actor self, int tries, ref Target target) { return false; }
protected virtual bool CanReserve(Actor self) { return true; } protected virtual bool CanReserve(Actor self) { return true; }

View File

@@ -56,7 +56,7 @@ namespace OpenRA.Mods.Common.Effects
[Desc("Interval in ticks between each spawned Trail animation.")] [Desc("Interval in ticks between each spawned Trail animation.")]
public readonly int TrailInterval = 2; public readonly int TrailInterval = 2;
[Desc("Delay in ticks until trail animaion is spawned.")] [Desc("Delay in ticks until trail animation is spawned.")]
public readonly int TrailDelay = 1; public readonly int TrailDelay = 1;
[PaletteReference("TrailUsePlayerPalette")] public readonly string TrailPalette = "effect"; [PaletteReference("TrailUsePlayerPalette")] public readonly string TrailPalette = "effect";

View File

@@ -514,7 +514,7 @@ namespace OpenRA.Mods.Common.Effects
// Also, never change horizontal facing and never travel backwards // Also, never change horizontal facing and never travel backwards
// Possible techniques to avoid close cliffs are deceleration, turning // Possible techniques to avoid close cliffs are deceleration, turning
// as sharply as possible to travel directly upwards and then returning // as sharply as possible to travel directly upwards and then returning
// to zero vertical facing as low as possible while still not hittin the // to zero vertical facing as low as possible while still not hitting the
// high terrain. A last technique (and the preferred one, normally used when // high terrain. A last technique (and the preferred one, normally used when
// the missile hasn't been fired near a cliff) is simply finding the smallest // the missile hasn't been fired near a cliff) is simply finding the smallest
// vertical facing that allows for a smooth climb to the new terrain's height // vertical facing that allows for a smooth climb to the new terrain's height

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Server
{ {
public class ColorValidator : ServerTrait, IClientJoined public class ColorValidator : ServerTrait, IClientJoined
{ {
// The bigger the color threshold, the less permitive is the algorithm // The bigger the color threshold, the less permissive is the algorithm
const int ColorThreshold = 0x70; const int ColorThreshold = 0x70;
const byte ColorLowerBound = 0x80; const byte ColorLowerBound = 0x80;
const byte ColorHigherBound = 0xFF; const byte ColorHigherBound = 0xFF;
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.Common.Server
// Reduce vector by it's biggest value (more calculations, but more accuracy too) // Reduce vector by it's biggest value (more calculations, but more accuracy too)
var vectorMax = vector.Max(vv => Math.Abs(vv)); var vectorMax = vector.Max(vv => Math.Abs(vv));
if (vectorMax == 0) if (vectorMax == 0)
vectorMax = 1; // Avoid divison by 0 vectorMax = 1; // Avoid division by 0
vector[0] /= vectorMax; vector[0] /= vectorMax;
vector[1] /= vectorMax; vector[1] /= vectorMax;
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Server
alternativeColor[1] = forbiddenColor.G + (int)(vector[1] * weightVector[1] * ii); alternativeColor[1] = forbiddenColor.G + (int)(vector[1] * weightVector[1] * ii);
alternativeColor[2] = forbiddenColor.B + (int)(vector[2] * weightVector[2] * ii); alternativeColor[2] = forbiddenColor.B + (int)(vector[2] * weightVector[2] * ii);
// Be sure it doesnt go out of bounds (0x33 is the lower limit for HSL picker) // Be sure it doesn't go out of bounds (0x33 is the lower limit for HSL picker)
alternativeColor[0] = alternativeColor[0].Clamp(ColorLowerBound, ColorHigherBound); alternativeColor[0] = alternativeColor[0].Clamp(ColorLowerBound, ColorHigherBound);
alternativeColor[1] = alternativeColor[1].Clamp(ColorLowerBound, ColorHigherBound); alternativeColor[1] = alternativeColor[1].Clamp(ColorLowerBound, ColorHigherBound);
alternativeColor[2] = alternativeColor[2].Clamp(ColorLowerBound, ColorHigherBound); alternativeColor[2] = alternativeColor[2].Clamp(ColorLowerBound, ColorHigherBound);

View File

@@ -367,7 +367,7 @@ namespace OpenRA.Mods.Common.Server
foreach (var c in server.LobbyInfo.Clients) foreach (var c in server.LobbyInfo.Clients)
{ {
// Validate if color is allowed and get an alternative it it isn't // Validate if color is allowed and get an alternative it isn't
c.Color = c.PreferredColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, c.Color, c.Index, conn); c.Color = c.PreferredColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, c.Color, c.Index, conn);
} }
@@ -730,7 +730,7 @@ namespace OpenRA.Mods.Common.Server
var kickConn = server.Conns.SingleOrDefault(c => server.GetClient(c) != null && server.GetClient(c).Index == kickClientID); var kickConn = server.Conns.SingleOrDefault(c => server.GetClient(c) != null && server.GetClient(c).Index == kickClientID);
if (kickConn == null) if (kickConn == null)
{ {
server.SendOrderTo(conn, "Message", "Noone in that slot."); server.SendOrderTo(conn, "Message", "No-one in that slot.");
return true; return true;
} }
@@ -869,7 +869,7 @@ namespace OpenRA.Mods.Common.Server
var newHslColor = FieldLoader.GetValue<HSLColor>("(value)", parts[1]); var newHslColor = FieldLoader.GetValue<HSLColor>("(value)", parts[1]);
// Validate if color is allowed and get an alternative it it isn't // Validate if color is allowed and get an alternative it isn't
var altHslColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, newHslColor, targetClient.Index, conn); var altHslColor = ColorValidator.ValidatePlayerColorAndGetAlternative(server, newHslColor, targetClient.Index, conn);
targetClient.Color = altHslColor; targetClient.Color = altHslColor;

View File

@@ -145,7 +145,7 @@ namespace OpenRA.Mods.Common.SpriteLoaders
if (h.Format == Format.Format20) if (h.Format == Format.Format20)
h.RefImage = headers[i - 1]; h.RefImage = headers[i - 1];
else if (h.Format == Format.Format40 && !offsets.TryGetValue(h.RefOffset, out h.RefImage)) else if (h.Format == Format.Format40 && !offsets.TryGetValue(h.RefOffset, out h.RefImage))
throw new InvalidDataException("Reference doesnt point to image data {0}->{1}".F(h.FileOffset, h.RefOffset)); throw new InvalidDataException("Reference doesn't point to image data {0}->{1}".F(h.FileOffset, h.RefOffset));
} }
shpBytesFileOffset = stream.Position; shpBytesFileOffset = stream.Position;

View File

@@ -137,7 +137,7 @@ namespace OpenRA.Mods.Common.Traits
Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing; Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing;
// TODO: HACK: This is a hack until we can properly distinquish between airplane and helicopter! // TODO: HACK: This is a hack until we can properly distinguish between airplane and helicopter!
// Or until the activities get unified enough so that it doesn't matter. // Or until the activities get unified enough so that it doesn't matter.
IsPlane = !info.CanHover; IsPlane = !info.CanHover;
} }

View File

@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
protected override bool CanAttack(Actor self, Target target) protected override bool CanAttack(Actor self, Target target)
{ {
// dont fire while landed or when outside the map // Don't fire while landed or when outside the map.
return base.CanAttack(self, target) && self.CenterPosition.Z > 0 && self.World.Map.Contains(self.Location); return base.CanAttack(self, target) && self.CenterPosition.Z > 0 && self.World.Map.Contains(self.Location);
} }
} }

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
{ {
// nowhere to land, pick something friendly and circle over it. // nowhere to land, pick something friendly and circle over it.
// i'd prefer something we own // I'd prefer something we own
var someBuilding = self.World.ActorsHavingTrait<Building>() var someBuilding = self.World.ActorsHavingTrait<Building>()
.FirstOrDefault(a => a.Owner == self.Owner); .FirstOrDefault(a => a.Owner == self.Owner);

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Offset at which that the exiting actor is spawned relative to the center of the producing actor.")] [Desc("Offset at which that the exiting actor is spawned relative to the center of the producing actor.")]
public readonly WVec SpawnOffset = WVec.Zero; public readonly WVec SpawnOffset = WVec.Zero;
[Desc("Cell offset where the exiting actor enters the ActorMap relative to the topleft cell of the producting actor.")] [Desc("Cell offset where the exiting actor enters the ActorMap relative to the topleft cell of the producing actor.")]
public readonly CVec ExitCell = CVec.Zero; public readonly CVec ExitCell = CVec.Zero;
public readonly int Facing = -1; public readonly int Facing = -1;

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Overrides the IndicatorPalettePrefix.")] [Desc("Overrides the IndicatorPalettePrefix.")]
[PaletteReference] public readonly string IndicatorPalette = ""; [PaletteReference] public readonly string IndicatorPalette = "";
[Desc("Suffixed by the interal repairing player name.")] [Desc("Suffixed by the internal repairing player name.")]
public readonly string IndicatorPalettePrefix = "player"; public readonly string IndicatorPalettePrefix = "player";
public override object Create(ActorInitializer init) { return new RepairableBuilding(init.Self, this); } public override object Create(ActorInitializer init) { return new RepairableBuilding(init.Self, this); }

View File

@@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Traits
reservedFor = forActor; reservedFor = forActor;
reservedForAircraft = forAircraft; reservedForAircraft = forAircraft;
// NOTE: we really dont care about the GC eating DisposableActions that apply to a world *other* than // NOTE: we really don't care about the GC eating DisposableActions that apply to a world *other* than
// the one we're playing in. // the one we're playing in.
return new DisposableAction( return new DisposableAction(
() => { reservedFor = null; reservedForAircraft = null; }, () => { reservedFor = null; reservedForAircraft = null; },

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("How long (in ticks) the actor should panic for.")] [Desc("How long (in ticks) the actor should panic for.")]
public readonly int PanicLength = 25 * 10; public readonly int PanicLength = 25 * 10;
[Desc("Panic movement speed as a precentage of the normal speed.")] [Desc("Panic movement speed as a percentage of the normal speed.")]
public readonly int PanicSpeedModifier = 200; public readonly int PanicSpeedModifier = 200;
[Desc("Chance (out of 100) the unit has to enter panic mode when attacked.")] [Desc("Chance (out of 100) the unit has to enter panic mode when attacked.")]

View File

@@ -12,7 +12,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits namespace OpenRA.Mods.Common.Traits
{ {
[Desc("The inaccuracy of this actor is multipled based on upgrade level if specified.")] [Desc("The inaccuracy of this actor is multiplied based on upgrade level if specified.")]
public class InaccuracyMultiplierInfo : UpgradeMultiplierTraitInfo public class InaccuracyMultiplierInfo : UpgradeMultiplierTraitInfo
{ {
public override object Create(ActorInitializer init) { return new InaccuracyMultiplier(this, init.Self.Info.Name); } public override object Create(ActorInitializer init) { return new InaccuracyMultiplier(this, init.Self.Info.Name); }

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly bool SpeedUp = false; public readonly bool SpeedUp = false;
[Desc("Every time another production building of the same queue is", [Desc("Every time another production building of the same queue is",
"contructed, the build times of all actors in the queue", "constructed, the build times of all actors in the queue",
"decreased by a percentage of the original time.")] "decreased by a percentage of the original time.")]
public readonly int[] BuildTimeSpeedReduction = { 100, 85, 75, 65, 60, 55, 50 }; public readonly int[] BuildTimeSpeedReduction = { 100, 85, 75, 65, 60, 55, 50 };

View File

@@ -69,10 +69,10 @@ namespace OpenRA.Mods.Common.Traits
readonly Actor self; readonly Actor self;
// A list of things we could possibly build // A list of things we could possibly build
readonly Dictionary<ActorInfo, ProductionState> produceable = new Dictionary<ActorInfo, ProductionState>(); readonly Dictionary<ActorInfo, ProductionState> producible = new Dictionary<ActorInfo, ProductionState>();
readonly List<ProductionItem> queue = new List<ProductionItem>(); readonly List<ProductionItem> queue = new List<ProductionItem>();
readonly IEnumerable<ActorInfo> allProduceables; readonly IEnumerable<ActorInfo> allProducibles;
readonly IEnumerable<ActorInfo> buildableProduceables; readonly IEnumerable<ActorInfo> buildableProducibles;
// Will change if the owner changes // Will change if the owner changes
PowerManager playerPower; PowerManager playerPower;
@@ -102,9 +102,9 @@ namespace OpenRA.Mods.Common.Traits
Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName; Faction = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
Enabled = !info.Factions.Any() || info.Factions.Contains(Faction); Enabled = !info.Factions.Any() || info.Factions.Contains(Faction);
CacheProduceables(playerActor); CacheProducibles(playerActor);
allProduceables = produceable.Where(a => a.Value.Buildable || a.Value.Visible).Select(a => a.Key); allProducibles = producible.Where(a => a.Value.Buildable || a.Value.Visible).Select(a => a.Key);
buildableProduceables = produceable.Where(a => a.Value.Buildable).Select(a => a.Key); buildableProducibles = producible.Where(a => a.Value.Buildable).Select(a => a.Key);
} }
void ClearQueue() void ClearQueue()
@@ -131,9 +131,9 @@ namespace OpenRA.Mods.Common.Traits
Enabled = !Info.Factions.Any() || Info.Factions.Contains(Faction); Enabled = !Info.Factions.Any() || Info.Factions.Contains(Faction);
} }
// Regenerate the produceables and tech tree state // Regenerate the producibles and tech tree state
oldOwner.PlayerActor.Trait<TechTree>().Remove(this); oldOwner.PlayerActor.Trait<TechTree>().Remove(this);
CacheProduceables(newOwner.PlayerActor); CacheProducibles(newOwner.PlayerActor);
newOwner.PlayerActor.Trait<TechTree>().Update(); newOwner.PlayerActor.Trait<TechTree>().Update();
} }
@@ -145,9 +145,9 @@ namespace OpenRA.Mods.Common.Traits
public void OnTransform(Actor self) { } public void OnTransform(Actor self) { }
public void AfterTransform(Actor self) { } public void AfterTransform(Actor self) { }
void CacheProduceables(Actor playerActor) void CacheProducibles(Actor playerActor)
{ {
produceable.Clear(); producible.Clear();
if (!Enabled) if (!Enabled)
return; return;
@@ -157,7 +157,7 @@ namespace OpenRA.Mods.Common.Traits
{ {
var bi = a.TraitInfo<BuildableInfo>(); var bi = a.TraitInfo<BuildableInfo>();
produceable.Add(a, new ProductionState()); producible.Add(a, new ProductionState());
ttc.Add(a.Name, bi.Prerequisites, bi.BuildLimit, this); ttc.Add(a.Name, bi.Prerequisites, bi.BuildLimit, this);
} }
} }
@@ -173,22 +173,22 @@ namespace OpenRA.Mods.Common.Traits
public void PrerequisitesAvailable(string key) public void PrerequisitesAvailable(string key)
{ {
produceable[self.World.Map.Rules.Actors[key]].Buildable = true; producible[self.World.Map.Rules.Actors[key]].Buildable = true;
} }
public void PrerequisitesUnavailable(string key) public void PrerequisitesUnavailable(string key)
{ {
produceable[self.World.Map.Rules.Actors[key]].Buildable = false; producible[self.World.Map.Rules.Actors[key]].Buildable = false;
} }
public void PrerequisitesItemHidden(string key) public void PrerequisitesItemHidden(string key)
{ {
produceable[self.World.Map.Rules.Actors[key]].Visible = false; producible[self.World.Map.Rules.Actors[key]].Visible = false;
} }
public void PrerequisitesItemVisible(string key) public void PrerequisitesItemVisible(string key)
{ {
produceable[self.World.Map.Rules.Actors[key]].Visible = true; producible[self.World.Map.Rules.Actors[key]].Visible = true;
} }
public ProductionItem CurrentItem() public ProductionItem CurrentItem()
@@ -204,9 +204,9 @@ namespace OpenRA.Mods.Common.Traits
public virtual IEnumerable<ActorInfo> AllItems() public virtual IEnumerable<ActorInfo> AllItems()
{ {
if (self.World.AllowDevCommands && developerMode.AllTech) if (self.World.AllowDevCommands && developerMode.AllTech)
return produceable.Keys; return producible.Keys;
return allProduceables; return allProducibles;
} }
public virtual IEnumerable<ActorInfo> BuildableItems() public virtual IEnumerable<ActorInfo> BuildableItems()
@@ -214,15 +214,15 @@ namespace OpenRA.Mods.Common.Traits
if (!Enabled) if (!Enabled)
return Enumerable.Empty<ActorInfo>(); return Enumerable.Empty<ActorInfo>();
if (self.World.AllowDevCommands && developerMode.AllTech) if (self.World.AllowDevCommands && developerMode.AllTech)
return produceable.Keys; return producible.Keys;
return buildableProduceables; return buildableProducibles;
} }
public bool CanBuild(ActorInfo actor) public bool CanBuild(ActorInfo actor)
{ {
ProductionState ps; ProductionState ps;
if (!produceable.TryGetValue(actor, out ps)) if (!producible.TryGetValue(actor, out ps))
return false; return false;
return ps.Buildable || (self.World.AllowDevCommands && developerMode.AllTech); return ps.Buildable || (self.World.AllowDevCommands && developerMode.AllTech);
@@ -368,7 +368,7 @@ namespace OpenRA.Mods.Common.Traits
// Returns false if the unit can't be built // Returns false if the unit can't be built
protected virtual bool BuildUnit(string name) protected virtual bool BuildUnit(string name)
{ {
// Cannot produce if i'm dead // Cannot produce if I'm dead
if (!self.IsInWorld || self.IsDead) if (!self.IsInWorld || self.IsDead)
{ {
CancelProduction(name, 1); CancelProduction(name, 1);

View File

@@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Traits
{ {
if (Holding) if (Holding)
{ {
// Hah! We met ths critical owned condition // Hah! We met this critical owned condition
if (--TicksLeft == 0) if (--TicksLeft == 0)
mo.MarkCompleted(player, objectiveID); mo.MarkCompleted(player, objectiveID);
} }

View File

@@ -122,7 +122,7 @@ namespace OpenRA.Mods.Common.Traits
WorldUtils.AreMutualAllies(a.Owner, currentOwner) || !CanBeCapturedBy(a)); WorldUtils.AreMutualAllies(a.Owner, currentOwner) || !CanBeCapturedBy(a));
} }
// TODO exclude other NeutralActor that arent permanent // TODO exclude other NeutralActor that aren't permanent
bool IsStillInRange(Actor self) bool IsStillInRange(Actor self)
{ {
return UnitsInRange().Any(a => a.Owner == self.Owner && CanBeCapturedBy(a)); return UnitsInRange().Any(a => a.Owner == self.Owner && CanBeCapturedBy(a));
@@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Traits
.Where(a => a.Owner != OriginalOwner && CanBeCapturedBy(a)); .Where(a => a.Owner != OriginalOwner && CanBeCapturedBy(a));
} }
// TODO exclude other NeutralActor that arent permanent // TODO exclude other NeutralActor that aren't permanent
Actor GetInRange(Actor self) Actor GetInRange(Actor self)
{ {
return CaptorsInRange(self).ClosestTo(self); return CaptorsInRange(self).ClosestTo(self);

View File

@@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Renders crates with both water and land variants.")] [Desc("Renders crates with both water and land variants.")]
class WithCrateBodyInfo : ITraitInfo, Requires<RenderSpritesInfo>, IRenderActorPreviewSpritesInfo class WithCrateBodyInfo : ITraitInfo, Requires<RenderSpritesInfo>, IRenderActorPreviewSpritesInfo
{ {
[Desc("Easteregg sequences to use in december.")] [Desc("Easteregg sequences to use in December.")]
public readonly string[] XmasImages = { }; public readonly string[] XmasImages = { };
[SequenceReference] public readonly string IdleSequence = "idle"; [SequenceReference] public readonly string IdleSequence = "idle";

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
if (discoverer != null && !string.IsNullOrEmpty(Info.Notification)) if (discoverer != null && !string.IsNullOrEmpty(Info.Notification))
Game.Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName); Game.Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName);
// Radar notificaion // Radar notification
if (Info.PingRadar && radarPings.Value != null) if (Info.PingRadar && radarPings.Value != null)
radarPings.Value.Add(() => true, self.CenterPosition, Color.Red, 50); radarPings.Value.Add(() => true, self.CenterPosition, Color.Red, 50);
} }

View File

@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
// Different upgradeable traits may define (a) different level ranges for the same upgrade type, // Different upgradeable traits may define (a) different level ranges for the same upgrade type,
// and (b) multiple upgrade types for the same trait. The unrestricted level for each trait is // and (b) multiple upgrade types for the same trait. The unrestricted level for each trait is
// tracked independently so that we can can correctly revoke levels without adding the burden of // tracked independently so that we can correctly revoke levels without adding the burden of
// tracking both the overall (unclamped) and effective (clamped) levels on each individual trait. // tracking both the overall (unclamped) and effective (clamped) levels on each individual trait.
void NotifyUpgradeLevelChanged(IEnumerable<IUpgradable> traits, Actor self, string upgrade, int levelAdjust) void NotifyUpgradeLevelChanged(IEnumerable<IUpgradable> traits, Actor self, string upgrade, int levelAdjust)
{ {

View File

@@ -21,10 +21,10 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Number of ticks to wait before decreasing the effective move radius.")] [Desc("Number of ticks to wait before decreasing the effective move radius.")]
public readonly int TicksToWaitBeforeReducingMoveRadius = 5; public readonly int TicksToWaitBeforeReducingMoveRadius = 5;
[Desc("Mimimum ammount of ticks the actor will sit idly before starting to wander.")] [Desc("Minimum amount of ticks the actor will sit idly before starting to wander.")]
public readonly int MinMoveDelayInTicks = 0; public readonly int MinMoveDelayInTicks = 0;
[Desc("Maximum ammount of ticks the actor will sit idly before starting to wander.")] [Desc("Maximum amount of ticks the actor will sit idly before starting to wander.")]
public readonly int MaxMoveDelayInTicks = 0; public readonly int MaxMoveDelayInTicks = 0;
public abstract object Create(ActorInitializer init); public abstract object Create(ActorInitializer init);

View File

@@ -86,7 +86,7 @@ namespace OpenRA.Mods.Common.Traits
foreach (var cell in dirtyCells) foreach (var cell in dirtyCells)
{ {
// Select all neighbors inside the map boundries // Select all neighbors inside the map boundaries
var thisCell = cell; // benign closure hazard var thisCell = cell; // benign closure hazard
var neighbors = CVec.Directions.Select(d => d + thisCell) var neighbors = CVec.Directions.Select(d => d + thisCell)
.Where(c => map.Contains(c)); .Where(c => map.Contains(c));

View File

@@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly string Name = null; public readonly string Name = null;
[Desc("Map listed indices to shadow.")] [Desc("Map listed indices to shadow.")]
public readonly int[] ShadowIndex = { }; public readonly int[] ShadowIndex = { };
[Desc("Apply palette rotatotors or not.")] [Desc("Apply palette rotators or not.")]
public readonly bool AllowModifiers = true; public readonly bool AllowModifiers = true;
public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.World, this); } public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.World, this); }

View File

@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits
public void WorldLoaded(World w, WorldRenderer wr) public void WorldLoaded(World w, WorldRenderer wr)
{ {
// NOTE(jsd): 32 seems a sane default initial capacity for the total # of harvesters in a game. Purely a guesstimate. // 32 seems a sane default initial capacity for the total # of harvesters in a game. Purely a guesstimate.
claimByCell = new Dictionary<CPos, ResourceClaim>(32); claimByCell = new Dictionary<CPos, ResourceClaim>(32);
claimByActor = new Dictionary<Actor, ResourceClaim>(32); claimByActor = new Dictionary<Actor, ResourceClaim>(32);
} }

View File

@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
{ {
var actorReference = new ActorReference(kv.Value.Value, kv.Value.ToDictionary()); var actorReference = new ActorReference(kv.Value.Value, kv.Value.ToDictionary());
// if there is no real player associated, dont spawn it. // If there is no real player associated, don't spawn it.
var ownerName = actorReference.InitDict.Get<OwnerInit>().PlayerName; var ownerName = actorReference.InitDict.Get<OwnerInit>().PlayerName;
if (!world.Players.Any(p => p.InternalName == ownerName)) if (!world.Players.Any(p => p.InternalName == ownerName))
continue; continue;

View File

@@ -270,7 +270,7 @@ namespace OpenRA.Mods.Common.UtilityCommands
} }
} }
// AttackMove was generalized to support all moveable actor types // AttackMove was generalized to support all movable actor types
if (engineVersion < 20140116) if (engineVersion < 20140116)
{ {
if (depth == 1 && node.Key == "AttackMove") if (depth == 1 && node.Key == "AttackMove")

View File

@@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Widgets
public Func<int> GetPercentage; public Func<int> GetPercentage;
public Func<bool> IsIndeterminate; public Func<bool> IsIndeterminate;
// Indeterminant bar properties // Indeterminate bar properties
float offset = 0f; float offset = 0f;
float tickStep = 0.04f; float tickStep = 0.04f;

View File

@@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Widgets
RenderBounds.X + (RenderBounds.Width - scale * video.Width) / 2, RenderBounds.X + (RenderBounds.Width - scale * video.Width) / 2,
RenderBounds.Y + (RenderBounds.Height - scale * video.Height * AspectRatio) / 2); RenderBounds.Y + (RenderBounds.Height - scale * video.Height * AspectRatio) / 2);
// Round size to integer pixels. Round up to be consistent with the scale calcuation. // Round size to integer pixels. Round up to be consistent with the scale calculation.
videoSize = new float2((int)Math.Ceiling(video.Width * scale), (int)Math.Ceiling(video.Height * AspectRatio * scale)); videoSize = new float2((int)Math.Ceiling(video.Width * scale), (int)Math.Ceiling(video.Height * AspectRatio * scale));
if (!DrawOverlay) if (!DrawOverlay)

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Mods.D2k.Traits
if (!spawnPointActors.Value.Any()) if (!spawnPointActors.Value.Any())
return; return;
// Apparantly someone doesn't want worms or the maximum number of worms has been reached // Apparently someone doesn't want worms or the maximum number of worms has been reached
if (info.Maximum < 1 || wormsPresent >= info.Maximum) if (info.Maximum < 1 || wormsPresent >= info.Maximum)
return; return;

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Traits
public readonly bool ExplodeInstead = false; public readonly bool ExplodeInstead = false;
public readonly string ChronoshiftSound = "chrono2.aud"; public readonly string ChronoshiftSound = "chrono2.aud";
[Desc("Should the actor return to its previous location after the chronoshift weared out?")] [Desc("Should the actor return to its previous location after the chronoshift wore out?")]
public readonly bool ReturnToOrigin = true; public readonly bool ReturnToOrigin = true;
[Desc("The color the bar of the 'return-to-origin' logic has.")] [Desc("The color the bar of the 'return-to-origin' logic has.")]

View File

@@ -73,7 +73,7 @@ Root2:
// Merge order should not matter // Merge order should not matter
// Note: All the Merge* variants are different plumbing over the same // Note: All the Merge* variants are different plumbing over the same
// internal logic. Testing only MergeStrict is sufficent. // internal logic. Testing only MergeStrict is sufficient.
TestMixedMerge(MiniYaml.MergeStrict(a, b).First().Value); TestMixedMerge(MiniYaml.MergeStrict(a, b).First().Value);
TestMixedMerge(MiniYaml.MergeStrict(b, a).First().Value); TestMixedMerge(MiniYaml.MergeStrict(b, a).First().Value);
} }

View File

@@ -76,7 +76,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been anihilated!", "Mentat") Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat")
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
end end

View File

@@ -80,7 +80,7 @@ Tick = function()
end end
if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then if harkonnen.HasNoRequiredUnits() and not player.IsObjectiveCompleted(KillHarkonnen) then
Media.DisplayMessage("The Harkonnen have been anihilated!", "Mentat") Media.DisplayMessage("The Harkonnen have been annihilated!", "Mentat")
player.MarkCompletedObjective(KillHarkonnen) player.MarkCompletedObjective(KillHarkonnen)
end end
end end

View File

@@ -57,7 +57,7 @@ WorldLoaded = function()
end) end)
-- Discover the area around the bridge exposing the two german soldiers -- Discover the area around the bridge exposing the two german soldiers
-- When the two infantry near the bridge are discovered move them accross the bridge to waypoint4 -- When the two infantry near the bridge are discovered move them across the bridge to waypoint4
-- in the meanwhile one USSR soldier hunts them down -- in the meanwhile one USSR soldier hunts them down
Trigger.AfterDelay(DateTime.Seconds(1), function() Trigger.AfterDelay(DateTime.Seconds(1), function()
Actor.Create("camera", true, { Owner = player, Location = waypoint23.Location }) Actor.Create("camera", true, { Owner = player, Location = waypoint23.Location })
@@ -89,7 +89,7 @@ WorldLoaded = function()
return return
end end
-- Don't "shoot" at the barrels if there is noone to shoot -- Don't "shoot" at the barrels if there is no-one to shoot
if not FleeingUnits[1].IsDead then if not FleeingUnits[1].IsDead then
FleeingUnits[1].Attack(Barrel, true, true) FleeingUnits[1].Attack(Barrel, true, true)
elseif not FleeingUnits[2].IsDead then elseif not FleeingUnits[2].IsDead then