Merge pull request #10542 from RoosterDragon/simplify

General Cleanup
This commit is contained in:
abcdefg30
2016-01-18 11:37:30 +01:00
304 changed files with 218 additions and 639 deletions

View File

@@ -160,10 +160,10 @@ namespace OpenRA.Mods.Common.AI
public bool CanAttack(IEnumerable<Actor> ownUnits, IEnumerable<Actor> enemyUnits)
{
var inputValues = new Dictionary<FuzzyVariable, double>();
inputValues.Add(fuzzyEngine.InputByName("OwnHealth"), (double)NormalizedHealth(ownUnits, 100));
inputValues.Add(fuzzyEngine.InputByName("EnemyHealth"), (double)NormalizedHealth(enemyUnits, 100));
inputValues.Add(fuzzyEngine.InputByName("RelativeAttackPower"), (double)RelativePower(ownUnits, enemyUnits));
inputValues.Add(fuzzyEngine.InputByName("RelativeSpeed"), (double)RelativeSpeed(ownUnits, enemyUnits));
inputValues.Add(fuzzyEngine.InputByName("OwnHealth"), NormalizedHealth(ownUnits, 100));
inputValues.Add(fuzzyEngine.InputByName("EnemyHealth"), NormalizedHealth(enemyUnits, 100));
inputValues.Add(fuzzyEngine.InputByName("RelativeAttackPower"), RelativePower(ownUnits, enemyUnits));
inputValues.Add(fuzzyEngine.InputByName("RelativeSpeed"), RelativeSpeed(ownUnits, enemyUnits));
var result = fuzzyEngine.Calculate(inputValues);
var attackChance = result[fuzzyEngine.OutputByName("AttackOrFlee")];

View File

@@ -138,7 +138,7 @@ namespace OpenRA.Mods.Common.AI
[Desc("Should the AI repair its buildings if damaged?")]
public readonly bool ShouldRepairBuildings = true;
string IBotInfo.Name { get { return this.Name; } }
string IBotInfo.Name { get { return Name; } }
[Desc("What units to the AI should build.", "What % of the total army must be this type of unit.")]
public readonly Dictionary<string, float> UnitsToBuild = null;
@@ -245,7 +245,7 @@ namespace OpenRA.Mods.Common.AI
public readonly World World;
public Map Map { get { return World.Map; } }
IBotInfo IBot.Info { get { return this.Info; } }
IBotInfo IBot.Info { get { return Info; } }
int rushTicks;
int assignRolesTicks;

View File

@@ -9,7 +9,6 @@
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

View File

@@ -10,7 +10,6 @@
using System.Linq;
using OpenRA.Activities;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

View File

@@ -8,8 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common.Traits;

View File

@@ -8,12 +8,9 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Primitives;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Activities

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Effects;
using OpenRA.Mods.Common.Traits;

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Activities
protected Enter(Actor self, Actor target, EnterBehaviour enterBehaviour, int maxTries = 1, bool targetCenter = false)
{
this.move = self.Trait<IMove>();
move = self.Trait<IMove>();
this.target = Target.FromActor(target);
this.maxTries = maxTries;
this.enterBehaviour = enterBehaviour;

View File

@@ -10,7 +10,6 @@
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common.Pathfinder;
using OpenRA.Mods.Common.Traits;

View File

@@ -9,7 +9,6 @@
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Traits;

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Activities
return path;
};
this.destination = destination;
this.nearEnough = WDist.Zero;
nearEnough = WDist.Zero;
}
// HACK: for legacy code
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Activities
};
this.destination = destination;
this.nearEnough = WDist.Zero;
nearEnough = WDist.Zero;
this.ignoredActor = ignoredActor;
}

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;

View File

@@ -10,8 +10,6 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Activities

View File

@@ -12,7 +12,6 @@ using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Primitives;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Activities
{

View File

@@ -8,10 +8,7 @@
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Activities

View File

@@ -8,19 +8,11 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Orders;
using OpenRA.Primitives;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets
{

View File

@@ -10,17 +10,9 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Orders;
using OpenRA.Primitives;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets
{

View File

@@ -10,17 +10,10 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Orders;
using OpenRA.Primitives;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets
{

View File

@@ -8,19 +8,9 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Orders;
using OpenRA.Primitives;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets
{

View File

@@ -8,19 +8,9 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Graphics;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Orders;
using OpenRA.Primitives;
using OpenRA.Traits;
using OpenRA.Widgets;
namespace OpenRA.Mods.Common.Widgets
{

View File

@@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Effects;
using OpenRA.GameRules;
using OpenRA.Graphics;

View File

@@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Effects;
using OpenRA.GameRules;
using OpenRA.Graphics;
@@ -100,7 +99,7 @@ namespace OpenRA.Mods.Common.Effects
{
this.info = info;
this.args = args;
this.pos = args.Source;
pos = args.Source;
var world = args.SourceActor.World;

View File

@@ -29,11 +29,11 @@ namespace OpenRA.Mods.Common.Effects
public FloatingText(WPos pos, Color color, string text, int duration)
{
this.font = Game.Renderer.Fonts["TinyBold"];
font = Game.Renderer.Fonts["TinyBold"];
this.pos = pos;
this.color = color;
this.text = text;
this.remaining = duration;
remaining = duration;
}
public void Tick(World world)

View File

@@ -68,10 +68,10 @@ namespace OpenRA.Mods.Common.Effects
this.args = args;
this.info = info;
this.color = color;
this.target = args.PassiveTarget;
target = args.PassiveTarget;
if (!string.IsNullOrEmpty(info.HitAnim))
this.hitanim = new Animation(args.SourceActor.World, info.HitAnim);
hitanim = new Animation(args.SourceActor.World, info.HitAnim);
}
public void Tick(World world)

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Effects
this.firedBy = firedBy;
this.weapon = weapon;
this.delay = delay;
this.turn = delay / 2;
turn = delay / 2;
this.flashType = flashType;
var offset = new WVec(WDist.Zero, WDist.Zero, velocity * turn);

View File

@@ -122,25 +122,25 @@ namespace OpenRA.Mods.Common.Graphics
try
{
Start = LoadField<int>(d, "Start", 0);
ShadowStart = LoadField<int>(d, "ShadowStart", -1);
ShadowZOffset = LoadField<WDist>(d, "ShadowZOffset", DefaultShadowSpriteZOffset).Length;
ZOffset = LoadField<WDist>(d, "ZOffset", WDist.Zero).Length;
Tick = LoadField<int>(d, "Tick", 40);
transpose = LoadField<bool>(d, "Transpose", false);
Start = LoadField(d, "Start", 0);
ShadowStart = LoadField(d, "ShadowStart", -1);
ShadowZOffset = LoadField(d, "ShadowZOffset", DefaultShadowSpriteZOffset).Length;
ZOffset = LoadField(d, "ZOffset", WDist.Zero).Length;
Tick = LoadField(d, "Tick", 40);
transpose = LoadField(d, "Transpose", false);
Frames = LoadField<int[]>(d, "Frames", null);
var flipX = LoadField<bool>(d, "FlipX", false);
var flipY = LoadField<bool>(d, "FlipY", false);
var flipX = LoadField(d, "FlipX", false);
var flipY = LoadField(d, "FlipY", false);
Facings = LoadField<int>(d, "Facings", 1);
Facings = LoadField(d, "Facings", 1);
if (Facings < 0)
{
reverseFacings = true;
Facings = -Facings;
}
var offset = LoadField<float2>(d, "Offset", float2.Zero);
var blendMode = LoadField<BlendMode>(d, "BlendMode", BlendMode.Alpha);
var offset = LoadField(d, "Offset", float2.Zero);
var blendMode = LoadField(d, "BlendMode", BlendMode.Alpha);
MiniYaml combine;
if (d.TryGetValue("Combine", out combine))
@@ -151,10 +151,10 @@ namespace OpenRA.Mods.Common.Graphics
var sd = sub.Value.ToDictionary();
// Allow per-sprite offset, start, and length
var subStart = LoadField<int>(sd, "Start", 0);
var subOffset = LoadField<float2>(sd, "Offset", float2.Zero);
var subFlipX = LoadField<bool>(sd, "FlipX", false);
var subFlipY = LoadField<bool>(sd, "FlipY", false);
var subStart = LoadField(sd, "Start", 0);
var subOffset = LoadField(sd, "Offset", float2.Zero);
var subFlipX = LoadField(sd, "FlipX", false);
var subFlipY = LoadField(sd, "FlipY", false);
var subSrc = GetSpriteSrc(modData, tileSet, sequence, animation, sub.Key, sd);
var subSprites = cache[subSrc].Select(
@@ -165,7 +165,7 @@ namespace OpenRA.Mods.Common.Graphics
if (sd.TryGetValue("Length", out subLengthYaml) && subLengthYaml.Value == "*")
subLength = subSprites.Count() - subStart;
else
subLength = LoadField<int>(sd, "Length", 1);
subLength = LoadField(sd, "Length", 1);
combined = combined.Concat(subSprites.Skip(subStart).Take(subLength));
}
@@ -185,17 +185,17 @@ namespace OpenRA.Mods.Common.Graphics
if (d.TryGetValue("Length", out length) && length.Value == "*")
Length = sprites.Length - Start;
else
Length = LoadField<int>(d, "Length", 1);
Length = LoadField(d, "Length", 1);
// Plays the animation forwards, and then in reverse
if (LoadField<bool>(d, "Reverses", false))
if (LoadField(d, "Reverses", false))
{
var frames = Frames ?? Exts.MakeArray(Length, i => Start + i);
Frames = frames.Concat(frames.Skip(1).Take(frames.Length - 2).Reverse()).ToArray();
Length = 2 * Length - 2;
}
Stride = LoadField<int>(d, "Stride", Length);
Stride = LoadField(d, "Stride", Length);
if (Length > Stride)
throw new InvalidOperationException(

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Graphics
this.centerPosition = centerPosition;
this.radius = radius;
this.zOffset = zOffset;
this.trailCount = lineTrails;
trailCount = lineTrails;
this.trailSeparation = trailSeparation;
this.trailAngle = trailAngle;
this.color = color;

View File

@@ -55,10 +55,10 @@ namespace OpenRA.Mods.Common.Graphics
{
var wcr = Game.Renderer.WorldRgbaColorRenderer;
var offset = new WVec(radius.Length, 0, 0);
for (var i = 0; i < RangeCircleRenderable.RangeCircleSegments; i++)
for (var i = 0; i < RangeCircleSegments; i++)
{
var a = wr.ScreenPosition(centerPosition + offset.Rotate(RangeCircleRenderable.RangeCircleStartRotations[i]));
var b = wr.ScreenPosition(centerPosition + offset.Rotate(RangeCircleRenderable.RangeCircleEndRotations[i]));
var a = wr.ScreenPosition(centerPosition + offset.Rotate(RangeCircleStartRotations[i]));
var b = wr.ScreenPosition(centerPosition + offset.Rotate(RangeCircleEndRotations[i]));
if (contrastWidth > 0)
wcr.DrawLine(a, b, contrastWidth / wr.Viewport.Zoom, contrastColor);

View File

@@ -10,7 +10,6 @@
using System.Drawing;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Graphics
{

View File

@@ -8,10 +8,8 @@
*/
#endregion
using System;
using System.Collections.Generic;
using OpenRA.Graphics;
using OpenRA.Primitives;
namespace OpenRA.Mods.Common.Graphics
{

View File

@@ -8,9 +8,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using OpenRA.Graphics;
@@ -69,16 +67,16 @@ namespace OpenRA.Mods.Common.Graphics
var spriteName = sprite ?? sequence;
if (LoadField<bool>(d, "UseTilesetCode", false))
if (LoadField(d, "UseTilesetCode", false))
{
string code;
if (loader.TilesetCodes.TryGetValue(ResolveTilesetId(tileSet, d), out code))
spriteName = spriteName.Substring(0, 1) + code + spriteName.Substring(2, spriteName.Length - 2);
}
if (LoadField<bool>(d, "AddExtension", true))
if (LoadField(d, "AddExtension", true))
{
var useTilesetExtension = LoadField<bool>(d, "UseTilesetExtension", false);
var useTilesetExtension = LoadField(d, "UseTilesetExtension", false);
string tilesetExtension;
if (useTilesetExtension && loader.TilesetExtensions.TryGetValue(ResolveTilesetId(tileSet, d), out tilesetExtension))

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using OpenRA.Graphics;
@@ -52,8 +51,8 @@ namespace OpenRA.Mods.Common.Graphics
public IEnumerable<IRenderable> Render(WorldRenderer wr, WPos pos)
{
yield return new VoxelRenderable(components, pos + offset, zOffset, camera, this.scale,
lightSource, this.lightAmbientColor, this.lightDiffuseColor,
yield return new VoxelRenderable(components, pos + offset, zOffset, camera, scale,
lightSource, lightAmbientColor, lightDiffuseColor,
colorPalette, normalsPalette, shadowPalette);
}
}

View File

@@ -43,9 +43,9 @@ namespace OpenRA.Mods.Common.Graphics
this.lightSource = lightSource;
this.lightAmbientColor = lightAmbientColor;
this.lightDiffuseColor = lightDiffuseColor;
this.palette = color;
this.normalsPalette = normals;
this.shadowPalette = shadow;
palette = color;
normalsPalette = normals;
shadowPalette = shadow;
}
public WPos Pos { get { return pos; } }
@@ -97,7 +97,7 @@ namespace OpenRA.Mods.Common.Graphics
var draw = voxel.voxels.Where(v => v.DisableFunc == null || !v.DisableFunc());
renderProxy = Game.Renderer.WorldVoxelRenderer.RenderAsync(
wr, draw, voxel.camera, voxel.scale, VoxelRenderable.GroundNormal, voxel.lightSource,
wr, draw, voxel.camera, voxel.scale, GroundNormal, voxel.lightSource,
voxel.lightAmbientColor, voxel.lightDiffuseColor,
voxel.palette, voxel.normalsPalette, voxel.shadowPalette);
}

View File

@@ -10,8 +10,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using OpenRA.Traits;
using OpenRA.Widgets;

View File

@@ -10,7 +10,6 @@
using System;
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Lint

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Lint

View File

@@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Lint

View File

@@ -10,7 +10,6 @@
using System;
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

View File

@@ -12,7 +12,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

View File

@@ -10,7 +10,6 @@
using System;
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Effects;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.Common.Warheads;

View File

@@ -10,7 +10,6 @@
using System;
using System.Linq;
using System.Reflection;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Lint

View File

@@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using OpenRA.FileFormats;
using OpenRA.Mods.Common.Widgets.Logic;
using OpenRA.Widgets;

View File

@@ -25,8 +25,8 @@ namespace OpenRA.Mods.Common.Orders
public DeployOrderTargeter(string order, int priority, Func<string> cursor)
{
this.OrderID = order;
this.OrderPriority = priority;
OrderID = order;
OrderPriority = priority;
this.cursor = cursor;
}

View File

@@ -12,7 +12,6 @@ using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Orders
{

View File

@@ -12,11 +12,9 @@ using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Primitives;
using OpenRA.Traits;
using Util = OpenRA.Traits.Util;
namespace OpenRA.Mods.Common.Orders

View File

@@ -9,7 +9,6 @@
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Orders
@@ -21,8 +20,8 @@ namespace OpenRA.Mods.Common.Orders
public UnitOrderTargeter(string order, int priority, string cursor, bool targetEnemyUnits, bool targetAllyUnits)
{
this.OrderID = order;
this.OrderPriority = priority;
OrderID = order;
OrderPriority = priority;
this.cursor = cursor;
this.targetEnemyUnits = targetEnemyUnits;
this.targetAllyUnits = targetAllyUnits;

View File

@@ -10,7 +10,6 @@
using System;
using System.Collections.Generic;
using System.Text;
using OpenRA.Primitives;
namespace OpenRA.Mods.Common.Pathfinder

View File

@@ -8,9 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
namespace OpenRA.Mods.Common.Pathfinder
{
/// <summary>

View File

@@ -12,7 +12,6 @@ using System;
using Eluant;
using OpenRA.Activities;
using OpenRA.Scripting;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Activities
{

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Linq;
using OpenRA.Mods.Common.Effects;
using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting;

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using Eluant;
using OpenRA.Scripting;
namespace OpenRA.Mods.Common.Scripting

View File

@@ -9,7 +9,6 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using Eluant;
using OpenRA.Effects;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;

View File

@@ -9,7 +9,6 @@
#endregion
using System.Linq;
using Eluant;
using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting;
using OpenRA.Traits;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Linq;
using Eluant;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Traits;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Linq;
using Eluant;
using OpenRA.Activities;

View File

@@ -8,10 +8,6 @@
*/
#endregion
using System;
using System.Linq;
using Eluant;
using OpenRA.Activities;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting;

View File

@@ -8,9 +8,6 @@
*/
#endregion
using System;
using Eluant;
using OpenRA.Network;
using OpenRA.Scripting;
using OpenRA.Traits;

View File

@@ -8,11 +8,9 @@
*/
#endregion
using System;
using Eluant;
using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Scripting
{

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using Eluant;

View File

@@ -8,10 +8,7 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using Eluant;
using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting;
using OpenRA.Traits;

View File

@@ -13,7 +13,6 @@ using System.Collections.Generic;
using System.Linq;
using Eluant;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Scripting;
using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting;
using OpenRA.Traits;

View File

@@ -10,7 +10,6 @@
using System;
using System.IO;
using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Scripting;
using OpenRA.Traits;

View File

@@ -13,7 +13,6 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Network;
using OpenRA.Server;
using S = OpenRA.Server.Server;
@@ -199,7 +198,7 @@ namespace OpenRA.Mods.Common.Server
// Validate whether color is allowed and get an alternative if it isn't
if (client.Slot == null || !server.LobbyInfo.Slots[client.Slot].LockColor)
client.Color = ColorValidator.ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index);
client.Color = ValidatePlayerColorAndGetAlternative(server, client.Color, client.Index);
}
#endregion

View File

@@ -10,7 +10,6 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
@@ -760,7 +759,7 @@ namespace OpenRA.Mods.Common.Server
{ "name",
s =>
{
var sanitizedName = OpenRA.Settings.SanitizedPlayerName(s);
var sanitizedName = Settings.SanitizedPlayerName(s);
if (sanitizedName == client.Name)
return true;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Linq;
using OpenRA.Server;
using S = OpenRA.Server.Server;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Linq;
using OpenRA.Traits;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Mods.Common.Activities;
using OpenRA.Traits;

View File

@@ -8,8 +8,6 @@
*/
#endregion
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("Used to define weapon efficiency modifiers with different percentages per Type.")]

View File

@@ -305,8 +305,8 @@ namespace OpenRA.Mods.Common.Traits
public AttackOrderTargeter(AttackBase ab, int priority, bool negativeDamage)
{
this.ab = ab;
this.OrderID = ab.attackOrderName;
this.OrderPriority = priority;
OrderID = ab.attackOrderName;
OrderPriority = priority;
}
public string OrderID { get; private set; }

View File

@@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Graphics;
using OpenRA.Traits;
@@ -82,7 +81,7 @@ namespace OpenRA.Mods.Common.Traits
public AttackGarrisoned(Actor self, AttackGarrisonedInfo info)
: base(self, info)
{
this.Info = info;
Info = info;
coords = Exts.Lazy(() => self.Trait<BodyOrientation>());
armaments = new List<Armament>();
muzzles = new List<AnimationWithOffset>();

View File

@@ -11,8 +11,6 @@
using System.Collections.Generic;
using System.Drawing;
using OpenRA.Activities;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Activities;
using OpenRA.Mods.Common.Orders;
using OpenRA.Traits;

View File

@@ -8,9 +8,7 @@
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using OpenRA.Mods.Common.Activities;
using OpenRA.Traits;

View File

@@ -9,7 +9,6 @@
#endregion
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{

View File

@@ -9,8 +9,6 @@
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -154,9 +154,9 @@ namespace OpenRA.Mods.Common.Traits
public Building(ActorInitializer init, BuildingInfo info)
{
this.self = init.Self;
this.topLeft = init.Get<LocationInit, CPos>();
this.Info = info;
self = init.Self;
topLeft = init.Get<LocationInit, CPos>();
Info = info;
occupiedCells = FootprintUtils.UnpathableTiles(self.Info.Name, Info, TopLeft)
.Select(c => Pair.New(c, SubCell.FullCell)).ToArray();

View File

@@ -10,7 +10,6 @@
using System.Collections.Generic;
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{

View File

@@ -8,8 +8,6 @@
*/
#endregion
using System.Collections.Generic;
using OpenRA.Mods.Common.Effects;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
{
public static IEnumerable<CPos> Tiles(Ruleset rules, string name, BuildingInfo buildingInfo, CPos topLeft)
{
var dim = (CVec)buildingInfo.Dimensions;
var dim = buildingInfo.Dimensions;
var footprint = buildingInfo.Footprint.Where(x => !char.IsWhiteSpace(x));
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits
public static IEnumerable<CPos> UnpathableTiles(string name, BuildingInfo buildingInfo, CPos position)
{
var footprint = buildingInfo.Footprint.Where(x => !char.IsWhiteSpace(x)).ToArray();
foreach (var tile in TilesWhere(name, (CVec)buildingInfo.Dimensions, footprint, a => a == 'x'))
foreach (var tile in TilesWhere(name, buildingInfo.Dimensions, footprint, a => a == 'x'))
yield return tile + position;
}

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits
public Crate(ActorInitializer init, CrateInfo info)
{
this.self = init.Self;
self = init.Self;
this.info = info;
if (init.Contains<LocationInit>())

View File

@@ -9,7 +9,6 @@
#endregion
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{

View File

@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits
{
var gainsExperience = recipient.TraitOrDefault<GainsExperience>();
if (gainsExperience != null)
gainsExperience.GiveLevels(((LevelUpCrateActionInfo)info).Levels);
gainsExperience.GiveLevels(info.Levels);
});
}

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.GameRules;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -10,7 +10,6 @@
using System.Linq;
using OpenRA.Mods.Common.Effects;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -8,13 +8,8 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Activities;
using OpenRA.Orders;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Linq;
using OpenRA.Mods.Common.HitShapes;
using OpenRA.Traits;

View File

@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits
public Husk(ActorInitializer init, HuskInfo info)
{
this.info = info;
this.self = init.Self;
self = init.Self;
TopLeft = init.Get<LocationInit, CPos>();
CenterPosition = init.Contains<CenterPositionInit>() ? init.Get<CenterPositionInit, WPos>() : init.World.Map.CenterOfCell(TopLeft);

View File

@@ -13,7 +13,6 @@ using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Activities;
using OpenRA.Mods.Common;
using OpenRA.Mods.Common.Activities;
using OpenRA.Primitives;
using OpenRA.Traits;
@@ -84,7 +83,7 @@ namespace OpenRA.Mods.Common.Traits
var nodesDict = t.Value.ToDictionary();
var cost = nodesDict.ContainsKey("PathingCost")
? FieldLoader.GetValue<int>("cost", nodesDict["PathingCost"].Value)
: (int)(10000 / speed);
: 10000 / speed;
ret.Add(t.Key, new TerrainInfo(speed, cost));
}
@@ -369,7 +368,7 @@ namespace OpenRA.Mods.Common.Traits
SetVisualPosition(self, init.World.Map.CenterOfSubCell(FromCell, FromSubCell));
}
this.Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing;
Facing = init.Contains<FacingInit>() ? init.Get<FacingInit, int>() : info.InitialFacing;
// Sets the visual position to WPos accuracy
// Use LocationInit if you want to insert the actor into the ActorMap!
@@ -704,7 +703,7 @@ namespace OpenRA.Mods.Common.Traits
public MoveOrderTargeter(Actor self, Mobile unit)
{
this.mobile = unit;
mobile = unit;
rejectMove = !self.AcceptsOrder("Move");
}

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;

View File

@@ -8,11 +8,6 @@
*/
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
{
[Desc("The actor stays invisible under fog of war.")]

View File

@@ -9,7 +9,6 @@
#endregion
using System.Collections.Generic;
using System.Linq;
using OpenRA.Graphics;
using OpenRA.Traits;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using OpenRA.GameRules;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -8,10 +8,6 @@
*/
#endregion
using System;
using System.Linq;
using OpenRA;
using OpenRA.GameRules;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using OpenRA.Graphics;
using OpenRA.Traits;

View File

@@ -8,7 +8,6 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
using OpenRA.Graphics;
using OpenRA.Traits;

Some files were not shown because too many files have changed in this diff Show More