Style fixes

This commit is contained in:
reaperrr
2014-12-26 22:10:52 +01:00
parent d074fb4471
commit 311e347ad2
9 changed files with 24 additions and 25 deletions

View File

@@ -51,6 +51,7 @@ namespace OpenRA.Mods.Common.Traits
if (target.IsInRange(center, WRange.FromCells(bp.Trait.Info.Range)))
return bp.Actor;
}
return null;
}
@@ -64,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
var buildingMaxBounds = Dimensions;
var buildingTraits = world.Map.Rules.Actors[buildingName].Traits;
if (buildingTraits.Contains<BibInfo>() && !(buildingTraits.Get<BibInfo>().HasMinibib))
if (buildingTraits.Contains<BibInfo>() && !buildingTraits.Get<BibInfo>().HasMinibib)
buildingMaxBounds += new CVec(0, 1);
var scanStart = world.Map.Clamp(topLeft - new CVec(Adjacent, Adjacent));
@@ -184,6 +185,7 @@ namespace OpenRA.Mods.Common.Traits
foreach (var s in Info.UndeploySounds)
Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
}
public void OnTransform(Actor self) { }
public void AfterTransform(Actor self) { }
}

View File

@@ -66,10 +66,9 @@ namespace OpenRA.Mods.Common.Traits
// Cell contains an actor. Is it the type we want?
if (world.ActorsWithTrait<LineBuildNode>().Any(a =>
(
a.Actor.Location == cell &&
a.Actor.Info.Traits.Get<LineBuildNodeInfo>().Types.Intersect(lbi.NodeTypes).Any()
)))
(a.Actor.Location == cell &&
a.Actor.Info.Traits.Get<LineBuildNodeInfo>()
.Types.Intersect(lbi.NodeTypes).Any())))
dirs[d] = i; // Cell contains actor of correct type
else
dirs[d] = -1; // Cell is blocked by another actor type

View File

@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
{
public FreeActor(ActorInitializer init, FreeActorInfo info)
{
if (init.Contains<FreeActorInit>() && !init.Get<FreeActorInit>().value)
if (init.Contains<FreeActorInit>() && !init.Get<FreeActorInit>().ActorValue)
return;
init.self.World.AddFrameEndTask(w =>
@@ -57,16 +57,16 @@ namespace OpenRA.Mods.Common.Traits
public class FreeActorInit : IActorInit<bool>
{
[FieldFromYamlKey]
public readonly bool value = true;
public readonly bool ActorValue = true;
public FreeActorInit() { }
public FreeActorInit(bool init) { value = init; }
public bool Value(World world) { return value; }
public FreeActorInit(bool init) { ActorValue = init; }
public bool Value(World world) { return ActorValue; }
}
public class ParentActorInit : IActorInit<Actor>
{
public readonly Actor value;
public ParentActorInit(Actor parent) { value = parent; }
public Actor Value(World world) { return value; }
public readonly Actor ActorValue;
public ParentActorInit(Actor parent) { ActorValue = parent; }
public Actor Value(World world) { return ActorValue; }
}
}

View File

@@ -8,8 +8,8 @@
*/
#endregion
using OpenRA.Graphics;
using OpenRA.Activities;
using OpenRA.Graphics;
using OpenRA.Traits;
namespace OpenRA.Mods.Common.Traits
@@ -60,7 +60,7 @@ namespace OpenRA.Mods.Common.Traits
public void MovingToRefinery(Actor self, CPos targetCell, Activity next) { }
public void MovementCancelled(Actor self) { }
static public int ZOffsetFromCenter(Actor self, WPos pos, int offset)
public static int ZOffsetFromCenter(Actor self, WPos pos, int offset)
{
var delta = self.CenterPosition - pos;
return delta.Y + delta.Z + offset;

View File

@@ -26,7 +26,6 @@ namespace OpenRA.Mods.Common.Warheads
public readonly string AddsResourceType = null;
// TODO: Allow maximum resource splatter to be defined. (Per tile, and in total).
public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers)
{
if (string.IsNullOrEmpty(AddsResourceType))

View File

@@ -23,7 +23,6 @@ namespace OpenRA.Mods.Common.Warheads
public readonly int[] Size = { 0, 0 };
// TODO: Allow maximum resource removal to be defined. (Per tile, and in total).
public override void DoImpact(Target target, Actor firedBy, IEnumerable<int> damageModifiers)
{
var world = firedBy.World;

View File

@@ -15,8 +15,8 @@ using System.Linq;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
using OpenRA.Mods.RA;
using OpenRA.Mods.RA.Traits;
using OpenRA.Mods.RA.Orders;
using OpenRA.Mods.RA.Traits;
using OpenRA.Network;
using OpenRA.Primitives;
using OpenRA.Traits;

View File

@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Traits
public BridgeHut(ActorInitializer init)
{
Bridge = init.Get<ParentActorInit>().value.Trait<Bridge>();
Bridge = init.Get<ParentActorInit>().ActorValue.Trait<Bridge>();
Bridge.AddHut(this);
FirstBridge = Bridge.Enumerate(0, true).Last();
}