Fix misc indentation errors.
This commit is contained in:
@@ -123,14 +123,14 @@ namespace OpenRA
|
||||
|
||||
// SEQUENCE -> BIT_STRING -> SEQUENCE -> INTEGER
|
||||
// Modulus is padded with a zero to avoid issues with the sign bit
|
||||
writer.Write((byte)0x02);
|
||||
writer.Write((byte)0x02);
|
||||
WriteTLVLength(writer, parameters.Modulus.Length + 1);
|
||||
writer.Write((byte)0);
|
||||
writer.Write(parameters.Modulus);
|
||||
|
||||
// SEQUENCE -> BIT_STRING -> SEQUENCE -> INTEGER
|
||||
// Exponent is padded with a zero to avoid issues with the sign bit
|
||||
writer.Write((byte)0x02);
|
||||
writer.Write((byte)0x02);
|
||||
WriteTLVLength(writer, parameters.Exponent.Length + 1);
|
||||
writer.Write((byte)0);
|
||||
writer.Write(parameters.Exponent);
|
||||
@@ -180,7 +180,7 @@ namespace OpenRA
|
||||
try
|
||||
{
|
||||
using (var rsa = new RSACryptoServiceProvider())
|
||||
{
|
||||
{
|
||||
rsa.ImportParameters(parameters);
|
||||
return Encoding.UTF8.GetString(rsa.Decrypt(Convert.FromBase64String(data), false));
|
||||
}
|
||||
@@ -203,7 +203,7 @@ namespace OpenRA
|
||||
try
|
||||
{
|
||||
using (var rsa = new RSACryptoServiceProvider())
|
||||
{
|
||||
{
|
||||
rsa.ImportParameters(parameters);
|
||||
using (var csp = SHA1.Create())
|
||||
return Convert.ToBase64String(rsa.SignHash(csp.ComputeHash(data), CryptoConfig.MapNameToOID("SHA1")));
|
||||
@@ -227,7 +227,7 @@ namespace OpenRA
|
||||
try
|
||||
{
|
||||
using (var rsa = new RSACryptoServiceProvider())
|
||||
{
|
||||
{
|
||||
rsa.ImportParameters(parameters);
|
||||
using (var csp = SHA1.Create())
|
||||
return rsa.VerifyHash(csp.ComputeHash(data), CryptoConfig.MapNameToOID("SHA1"), Convert.FromBase64String(signature));
|
||||
|
||||
@@ -168,8 +168,8 @@ namespace OpenRA.Support
|
||||
public readonly Grouping Closes;
|
||||
|
||||
public TokenTypeInfo(string symbol, Precedence precedence, Sides operandSides = Sides.None,
|
||||
Associativity associativity = Associativity.Left,
|
||||
Grouping opens = Grouping.None, Grouping closes = Grouping.None)
|
||||
Associativity associativity = Associativity.Left,
|
||||
Grouping opens = Grouping.None, Grouping closes = Grouping.None)
|
||||
{
|
||||
Symbol = symbol;
|
||||
Precedence = precedence;
|
||||
@@ -181,9 +181,9 @@ namespace OpenRA.Support
|
||||
}
|
||||
|
||||
public TokenTypeInfo(string symbol, Precedence precedence, Sides operandSides,
|
||||
Sides whitespaceSides,
|
||||
Associativity associativity = Associativity.Left,
|
||||
Grouping opens = Grouping.None, Grouping closes = Grouping.None)
|
||||
Sides whitespaceSides,
|
||||
Associativity associativity = Associativity.Left,
|
||||
Grouping opens = Grouping.None, Grouping closes = Grouping.None)
|
||||
{
|
||||
Symbol = symbol;
|
||||
Precedence = precedence;
|
||||
@@ -195,15 +195,14 @@ namespace OpenRA.Support
|
||||
}
|
||||
|
||||
public TokenTypeInfo(string symbol, Precedence precedence, Grouping opens, Grouping closes = Grouping.None,
|
||||
Associativity associativity = Associativity.Left)
|
||||
Associativity associativity = Associativity.Left)
|
||||
{
|
||||
Symbol = symbol;
|
||||
Precedence = precedence;
|
||||
WhitespaceSides = Sides.None;
|
||||
OperandSides = opens == Grouping.None ?
|
||||
(closes == Grouping.None ? Sides.None : Sides.Left)
|
||||
:
|
||||
(closes == Grouping.None ? Sides.Right : Sides.Both);
|
||||
(closes == Grouping.None ? Sides.None : Sides.Left) :
|
||||
(closes == Grouping.None ? Sides.Right : Sides.Both);
|
||||
Associativity = associativity;
|
||||
Opens = opens;
|
||||
Closes = closes;
|
||||
|
||||
@@ -39,9 +39,9 @@ namespace OpenRA.Mods.Common.Graphics
|
||||
|
||||
public TextRenderable(SpriteFont font, WPos pos, int zOffset, Color color, string text)
|
||||
: this(font, pos, zOffset, color,
|
||||
ChromeMetrics.Get<Color>("TextContrastColorDark"),
|
||||
ChromeMetrics.Get<Color>("TextContrastColorLight"),
|
||||
text) { }
|
||||
ChromeMetrics.Get<Color>("TextContrastColorDark"),
|
||||
ChromeMetrics.Get<Color>("TextContrastColorLight"),
|
||||
text) { }
|
||||
|
||||
public WPos Pos { get { return pos; } }
|
||||
public PaletteReference Palette { get { return null; } }
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Scripting
|
||||
}
|
||||
|
||||
[Desc("Call a function for each passenger when it enters a transport. " +
|
||||
"The callback function will be called as func(Actor transport, Actor passenger).")]
|
||||
"The callback function will be called as func(Actor transport, Actor passenger).")]
|
||||
public void OnPassengerEntered(Actor a, LuaFunction func)
|
||||
{
|
||||
GetScriptTriggers(a).RegisterCallback(Trigger.OnPassengerEntered, func, Context);
|
||||
|
||||
@@ -112,11 +112,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (State == CarryallState.Carrying)
|
||||
{
|
||||
if (!Carryable.IsDead)
|
||||
{
|
||||
var positionable = Carryable.Trait<IPositionable>();
|
||||
positionable.SetPosition(Carryable, self.Location);
|
||||
Carryable.Kill(e.Attacker);
|
||||
}
|
||||
{
|
||||
var positionable = Carryable.Trait<IPositionable>();
|
||||
positionable.SetPosition(Carryable, self.Location);
|
||||
Carryable.Kill(e.Attacker);
|
||||
}
|
||||
|
||||
Carryable = null;
|
||||
}
|
||||
|
||||
@@ -100,6 +100,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
rgbaRenderer.DrawLine(wr.Screen3DPosition(spawnPos), wr.Screen3DPosition(exitCellCenter), 1f, self.Owner.Color.RGB);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,15 +67,15 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
||||
var allMatch = true;
|
||||
for (var i = 0; i < lenImpl; i++)
|
||||
{
|
||||
var implementingParam = implementingMethodParams[i];
|
||||
var interfaceParam = interfaceMethodParams[i];
|
||||
if (implementingParam.ParameterType != interfaceParam.ParameterType
|
||||
var implementingParam = implementingMethodParams[i];
|
||||
var interfaceParam = interfaceMethodParams[i];
|
||||
if (implementingParam.ParameterType != interfaceParam.ParameterType
|
||||
|| implementingParam.Name != interfaceParam.Name
|
||||
|| implementingParam.IsOut != interfaceParam.IsOut)
|
||||
{
|
||||
{
|
||||
allMatch = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Explicitly implemented methods are never public in C#.
|
||||
|
||||
@@ -52,8 +52,8 @@ namespace OpenRA.Test
|
||||
void AssertParseFailure(string expression, string errorMessage)
|
||||
{
|
||||
var actualErrorMessage = Assert.Throws(typeof(InvalidDataException),
|
||||
() => new IntegerExpression(expression).Evaluate(testValues),
|
||||
expression).Message;
|
||||
() => new IntegerExpression(expression).Evaluate(testValues),
|
||||
expression).Message;
|
||||
Assert.AreEqual(errorMessage, actualErrorMessage, expression + " ===> " + actualErrorMessage);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user