fix indents everywhere

This commit is contained in:
Chris Forbes
2011-10-18 15:10:17 +13:00
parent 227bbc109e
commit bc6af1841b
180 changed files with 2707 additions and 2707 deletions

View File

@@ -22,10 +22,10 @@ namespace OpenRA.Mods.RA.Activities
int Range;
bool AllowMovement;
int nextPathTime;
int nextPathTime;
const int delayBetweenPathingAttempts = 20;
const int delaySpread = 5;
const int delayBetweenPathingAttempts = 20;
const int delaySpread = 5;
public Attack(Target target, int range, bool allowMovement)
{
@@ -58,16 +58,16 @@ namespace OpenRA.Mods.RA.Activities
if (targetable != null && !targetable.TargetableBy(Target.Actor, self))
return NextActivity;
if (!Combat.IsInRange(self.CenterLocation, Range, Target))
{
if (--nextPathTime > 0)
return this;
if (!Combat.IsInRange(self.CenterLocation, Range, Target))
{
if (--nextPathTime > 0)
return this;
nextPathTime = self.World.SharedRandom.Next(delayBetweenPathingAttempts - delaySpread,
delayBetweenPathingAttempts + delaySpread);
nextPathTime = self.World.SharedRandom.Next(delayBetweenPathingAttempts - delaySpread,
delayBetweenPathingAttempts + delaySpread);
return (AllowMovement) ? Util.SequenceActivities(self.Trait<Mobile>().MoveWithinRange(Target, Range), this) : NextActivity;
}
return (AllowMovement) ? Util.SequenceActivities(self.Trait<Mobile>().MoveWithinRange(Target, Range), this) : NextActivity;
}
var desiredFacing = Util.GetFacing(Target.CenterLocation - self.CenterLocation, 0);
if (facing.Facing != desiredFacing)

View File

@@ -14,30 +14,30 @@ using OpenRA.Mods.RA.Effects;
namespace OpenRA.Mods.RA.Activities
{
class DonateSupplies : Activity
{
Actor target;
int payload;
class DonateSupplies : Activity
{
Actor target;
int payload;
public DonateSupplies(Actor target, int payload)
{
this.target = target;
this.payload = payload;
}
public DonateSupplies(Actor target, int payload)
{
this.target = target;
this.payload = payload;
}
public override Activity Tick(Actor self)
{
if (IsCanceled) return NextActivity;
if (target == null || !target.IsInWorld || target.IsDead()) return NextActivity;
if (!target.OccupiesSpace.OccupiedCells().Any(x => x.First == self.Location))
return NextActivity;
public override Activity Tick(Actor self)
{
if (IsCanceled) return NextActivity;
if (target == null || !target.IsInWorld || target.IsDead()) return NextActivity;
if (!target.OccupiesSpace.OccupiedCells().Any(x => x.First == self.Location))
return NextActivity;
target.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(payload);
self.Destroy();
target.Owner.PlayerActor.Trait<PlayerResources>().GiveCash(payload);
self.Destroy();
if (self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally)
self.World.AddFrameEndTask(w => w.Add(new CashTick(payload, 30, 2, target.CenterLocation, target.Owner.ColorRamp.GetColor(0))));
return this;
}
}
return this;
}
}
}

View File

@@ -17,10 +17,10 @@ namespace OpenRA.Mods.RA.Activities
{
Target Target;
int Range;
int nextPathTime;
int nextPathTime;
const int delayBetweenPathingAttempts = 20;
const int delaySpread = 5;
const int delayBetweenPathingAttempts = 20;
const int delaySpread = 5;
public Follow(Target target, int range)
{
@@ -36,12 +36,12 @@ namespace OpenRA.Mods.RA.Activities
var inRange = ( Util.CellContaining( Target.CenterLocation ) - self.Location ).LengthSquared < Range * Range;
if( inRange ) return this;
if (--nextPathTime > 0) return this;
if (--nextPathTime > 0) return this;
nextPathTime = self.World.SharedRandom.Next(delayBetweenPathingAttempts - delaySpread,
delayBetweenPathingAttempts + delaySpread);
nextPathTime = self.World.SharedRandom.Next(delayBetweenPathingAttempts - delaySpread,
delayBetweenPathingAttempts + delaySpread);
var mobile = self.Trait<Mobile>();
var mobile = self.Trait<Mobile>();
return Util.SequenceActivities( mobile.MoveWithinRange( Target, Range ), this );
}
}

View File

@@ -17,16 +17,16 @@ namespace OpenRA.Mods.RA.Activities
public class Rearm : Activity
{
readonly LimitedAmmo limitedAmmo;
int ticksPerPip = 25 * 2;
int remainingTicks = 25 * 2;
int ticksPerPip = 25 * 2;
int remainingTicks = 25 * 2;
public Rearm(Actor self)
{
public Rearm(Actor self)
{
limitedAmmo = self.TraitOrDefault<LimitedAmmo>();
if (limitedAmmo != null)
ticksPerPip = limitedAmmo.ReloadTimePerAmmo();
remainingTicks = ticksPerPip;
}
ticksPerPip = limitedAmmo.ReloadTimePerAmmo();
remainingTicks = ticksPerPip;
}
public override Activity Tick(Actor self)
{

View File

@@ -31,8 +31,8 @@ namespace OpenRA.Mods.RA.Activities
foreach (var ns in self.TraitsImplementing<INotifySold>())
ns.Sold(self);
if (refund > 0 && self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally)
self.World.AddFrameEndTask(
if (refund > 0 && self.World.LocalPlayer != null && self.Owner.Stances[self.World.LocalPlayer] == Stance.Ally)
self.World.AddFrameEndTask(
w => w.Add(new CashTick(refund, 30, 2,
self.CenterLocation,
self.Owner.ColorRamp.GetColor(0))));