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