fix trailing whitespace everywhere

This commit is contained in:
Chris Forbes
2011-09-25 14:37:12 +13:00
parent 0eb98ef3b5
commit 55036cd58c
596 changed files with 3194 additions and 3194 deletions

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -16,7 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
class AirstrikePowerInfo : SupportPowerInfo
{
{
[ActorReference]
public readonly string UnitType = "badr.bomber";
[ActorReference]
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA
flare.QueueActivity(new Wait(info.FlareTime));
flare.QueueActivity(new RemoveSelf());
}
var a = w.CreateActor(info.UnitType, new TypeDictionary
{
new LocationInit( startPos ),

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -23,28 +23,28 @@ namespace OpenRA.Mods.RA
public readonly int Range = 1; // Range in cells
public readonly int Duration = 30; // Seconds
public readonly bool KillCargo = true;
public override object Create(ActorInitializer init) { return new ChronoshiftPower(init.self,this); }
}
class ChronoshiftPower : SupportPower
{
{
public ChronoshiftPower(Actor self, ChronoshiftPowerInfo info) : base(self, info) { }
public override IOrderGenerator OrderGenerator(string order, SupportPowerManager manager)
{
Sound.PlayToPlayer(manager.self.Owner, Info.SelectTargetSound);
return new SelectTarget(order, manager, this);
}
public override void Activate(Actor self, Order order)
{
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
// Trigger screen desaturate effect
foreach (var a in self.World.ActorsWithTrait<ChronoshiftPaletteEffect>())
a.Trait.Enable();
Sound.Play("chrono2.aud", Game.CellSize * order.TargetLocation);
Sound.Play("chrono2.aud", Game.CellSize * order.ExtraLocation);
foreach (var target in UnitsInRange(order.ExtraLocation))
@@ -66,10 +66,10 @@ namespace OpenRA.Mods.RA
var units = new List<Actor>();
foreach (var t in tiles)
units.AddRange(self.World.ActorMap.GetUnitsAt(t));
return units.Distinct().Where(a => a.HasTrait<Chronoshiftable>());
}
class SelectTarget : IOrderGenerator
{
readonly ChronoshiftPower power;
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.RA
readonly Sprite tile;
readonly SupportPowerManager manager;
readonly string order;
public SelectTarget(string order, SupportPowerManager manager, ChronoshiftPower power)
{
this.manager = manager;
@@ -102,7 +102,7 @@ namespace OpenRA.Mods.RA
if (!manager.Powers.ContainsKey(order))
world.CancelInputMode();
}
public void RenderAfterWorld(WorldRenderer wr, World world)
{
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos).ToInt2();
@@ -133,7 +133,7 @@ namespace OpenRA.Mods.RA
readonly Sprite validTile, invalidTile, sourceTile;
readonly SupportPowerManager manager;
readonly string order;
public SelectDestination(string order, SupportPowerManager manager, ChronoshiftPower power, int2 sourceLocation)
{
this.manager = manager;
@@ -146,7 +146,7 @@ namespace OpenRA.Mods.RA
invalidTile = SequenceProvider.GetSequence("overlay", "target-invalid").GetSprite(0);
sourceTile = SequenceProvider.GetSequence("overlay", "target-select").GetSprite(0);
}
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
if (mi.Button == MouseButton.Right)
@@ -154,11 +154,11 @@ namespace OpenRA.Mods.RA
world.CancelInputMode();
yield break;
}
var ret = OrderInner( world, xy, mi ).FirstOrDefault();
if (ret == null)
yield break;
world.CancelInputMode();
yield return ret;
}
@@ -173,7 +173,7 @@ namespace OpenRA.Mods.RA
ExtraLocation = sourceLocation
};
}
public void Tick(World world)
{
// Cancel the OG if we can't use the power
@@ -194,11 +194,11 @@ namespace OpenRA.Mods.RA
// Source tiles
foreach (var t in world.FindTilesInCircle(sourceLocation, range))
sourceTile.DrawAt( wr, Game.CellSize * t, "terrain" );
// Destination tiles
foreach (var t in world.FindTilesInCircle(xy, range))
sourceTile.DrawAt( wr, Game.CellSize * t, "terrain" );
// Unit previews
foreach (var unit in power.UnitsInRange(sourceLocation))
{
@@ -208,7 +208,7 @@ namespace OpenRA.Mods.RA
wr.GetPaletteIndex(r.Palette),
r.Scale*r.Sprite.size);
}
// Unit tiles
foreach (var unit in power.UnitsInRange(sourceLocation))
{
@@ -233,7 +233,7 @@ namespace OpenRA.Mods.RA
}
return canTeleport;
}
public string GetCursor(World world, int2 xy, MouseInput mi)
{
return IsValidTarget(xy) ? "chrono-target" : "move-blocked";

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA
{
public object Create (ActorInitializer init) { return new GpsWatcher(init.self.Owner); }
}
class GpsWatcher : ISync
{
[Sync] bool Launched = false;
@@ -98,7 +98,7 @@ namespace OpenRA.Mods.RA
{
self.Owner.PlayerActor.Trait<SupportPowerManager>().Powers[key].Activate(new Order());
}
public override void Activate(Actor self, Order order)
{
self.World.AddFrameEndTask(w =>
@@ -126,7 +126,7 @@ namespace OpenRA.Mods.RA
{
owner.RefreshGps(self);
}
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
{
RemoveGps(self);

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA
Sound.PlayToPlayer(manager.self.Owner, Info.SelectTargetSound);
return new SelectTarget(order, manager, this);
}
public override void Activate(Actor self, Order order)
{
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
@@ -52,10 +52,10 @@ namespace OpenRA.Mods.RA
var units = new List<Actor>();
foreach (var t in tiles)
units.AddRange(self.World.ActorMap.GetUnitsAt(t));
return units.Distinct().Where(a => a.HasTrait<IronCurtainable>());
}
class SelectTarget : IOrderGenerator
{
readonly IronCurtainPower power;
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.RA
readonly Sprite tile;
readonly SupportPowerManager manager;
readonly string order;
public SelectTarget(string order, SupportPowerManager manager, IronCurtainPower power)
{
this.manager = manager;
@@ -75,11 +75,11 @@ namespace OpenRA.Mods.RA
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
world.CancelInputMode();
world.CancelInputMode();
if (mi.Button == MouseButton.Left && power.UnitsInRange(xy).Any())
yield return new Order(order, manager.self, false) { TargetLocation = xy };
}
public void Tick(World world)
{
// Cancel the OG if we can't use the power

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA
[WeaponReference]
public readonly string MissileWeapon = "";
public readonly int2 SpawnOffset = int2.Zero;
public override object Create(ActorInitializer init) { return new NukePower(init.self, this); }
}
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA
Sound.PlayToPlayer(manager.self.Owner, Info.SelectTargetSound);
return new SelectGenericPowerTarget(order, manager, "nuke", MouseButton.Left);
}
public override void Activate(Actor self, Order order)
{
// Play to everyone but the current player
@@ -39,10 +39,10 @@ namespace OpenRA.Mods.RA
Sound.Play(Info.LaunchSound);
var npi = Info as NukePowerInfo;
self.Trait<RenderBuilding>().PlayCustomAnim(self, "active");
self.World.AddFrameEndTask(w => w.Add(
new NukeLaunch(self.Owner, self, npi.MissileWeapon, npi.SpawnOffset,
new NukeLaunch(self.Owner, self, npi.MissileWeapon, npi.SpawnOffset,
order.TargetLocation)));
}
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
{
var items = (Info as ParatroopersPowerInfo).DropItems;
var startPos = self.World.ChooseRandomEdgeCell();
self.World.AddFrameEndTask(w =>
{
var info = (Info as ParatroopersPowerInfo);
@@ -53,21 +53,21 @@ namespace OpenRA.Mods.RA
flare.QueueActivity(new RemoveSelf());
}
var a = w.CreateActor(info.UnitType, new TypeDictionary
var a = w.CreateActor(info.UnitType, new TypeDictionary
{
new LocationInit( startPos ),
new OwnerInit( self.Owner ),
new FacingInit( Util.GetFacing(order.TargetLocation - startPos, 0) ),
new AltitudeInit( Rules.Info[info.UnitType].Traits.Get<PlaneInfo>().CruiseAltitude ),
});
a.CancelActivity();
a.QueueActivity(new FlyAttack(Target.FromOrder(order)));
a.Trait<ParaDrop>().SetLZ(order.TargetLocation);
var cargo = a.Trait<Cargo>();
foreach (var i in items)
cargo.Load(a, self.World.CreateActor(false, i.ToLowerInvariant(),
cargo.Load(a, self.World.CreateActor(false, i.ToLowerInvariant(),
new TypeDictionary { new OwnerInit( a.Owner ) }));
});
}

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA
{
var enterCell = self.World.ChooseRandomEdgeCell();
var plane = self.World.CreateActor("u2", new TypeDictionary
var plane = self.World.CreateActor("u2", new TypeDictionary
{
new LocationInit( enterCell ),
new OwnerInit( self.Owner ),
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA
plane.CancelActivity();
plane.QueueActivity(Fly.ToCell(order.TargetLocation));
plane.QueueActivity(new CallFunc(() => plane.World.AddFrameEndTask( w =>
plane.QueueActivity(new CallFunc(() => plane.World.AddFrameEndTask( w =>
{
var camera = w.CreateActor("camera", new TypeDictionary
{

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA
public readonly string LongDesc = "";
public readonly bool AllowMultiple = false;
public readonly bool OneShot = false;
public readonly string BeginChargeSound = null;
public readonly string EndChargeSound = null;
public readonly string SelectTargetSound = null;
@@ -38,18 +38,18 @@ namespace OpenRA.Mods.RA
{
public readonly Actor self;
public readonly SupportPowerInfo Info;
public SupportPower(Actor self, SupportPowerInfo info)
{
Info = info;
this.self = self;
}
public virtual void Charging(Actor self, string key)
{
Sound.PlayToPlayer(self.Owner, Info.BeginChargeSound);
}
public virtual void Charged(Actor self, string key)
{
Sound.PlayToPlayer(self.Owner, Info.EndChargeSound);

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.

View File

@@ -1,7 +1,7 @@
#region Copyright & License Information
/*
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
* This file is part of OpenRA, which is free software. It is made
* This file is part of OpenRA, which is free software. It is made
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA
{
public readonly Actor self;
public Dictionary<string, SupportPowerInstance> Powers = new Dictionary<string, SupportPowerInstance>();
public readonly DeveloperMode devMode;
public SupportPowerManager(ActorInitializer init)
{
@@ -40,16 +40,16 @@ namespace OpenRA.Mods.RA
{
return sp.Info.AllowMultiple ? sp.Info.OrderName + "_" + sp.self.ActorID : sp.Info.OrderName;
}
void ActorAdded(Actor a)
{
if (a.Owner != self.Owner || !a.HasTrait<SupportPower>())
return;
foreach (var t in a.TraitsImplementing<SupportPower>())
{
var key = MakeKey(t);
if (Powers.ContainsKey(key))
{
Powers[key].Instances.Add(t);
@@ -62,17 +62,17 @@ namespace OpenRA.Mods.RA
RemainingTime = t.Info.ChargeTime * 25,
TotalTime = t.Info.ChargeTime * 25,
};
Powers.Add(key, si);
}
}
}
void ActorRemoved(Actor a)
{
if (a.Owner != self.Owner || !a.HasTrait<SupportPower>())
return;
foreach (var t in a.TraitsImplementing<SupportPower>())
{
var key = MakeKey(t);
@@ -81,27 +81,27 @@ namespace OpenRA.Mods.RA
Powers.Remove(key);
}
}
public void Tick(Actor self)
{
foreach(var power in Powers.Values)
power.Tick();
}
public void ResolveOrder(Actor self, Order order)
{
// order.OrderString is the key of the support power
if (Powers.ContainsKey(order.OrderString))
Powers[order.OrderString].Activate(order);
}
public void Target(string key)
{
if (Powers.ContainsKey(key))
Powers[key].Target();
}
static readonly SupportPowerInstance[] NoInstances = {};
static readonly SupportPowerInstance[] NoInstances = {};
public IEnumerable<SupportPowerInstance> GetPowersForActor(Actor a)
{
@@ -111,21 +111,21 @@ namespace OpenRA.Mods.RA
return a.TraitsImplementing<SupportPower>()
.Select(t => Powers[MakeKey(t)]);
}
public class SupportPowerInstance
{
readonly SupportPowerManager Manager;
readonly string Key;
public List<SupportPower> Instances;
public int RemainingTime;
public int TotalTime;
public bool Active { get; private set; }
public bool Disabled { get; private set; }
public SupportPowerInfo Info { get { return Instances.First().Info; } }
public bool Ready { get { return Active && RemainingTime == 0; } }
public SupportPowerInstance(string key, SupportPowerManager manager)
{
Manager = manager;
@@ -136,7 +136,7 @@ namespace OpenRA.Mods.RA
{
return sp.self.TraitsImplementing<IDisable>().Any(d => d.Disabled);
}
bool notifiedCharging;
bool notifiedReady;
public void Tick()
@@ -148,14 +148,14 @@ namespace OpenRA.Mods.RA
var power = Instances.First();
if (Manager.devMode.FastCharge && RemainingTime > 25)
RemainingTime = 25;
if (RemainingTime > 0) --RemainingTime;
if (!notifiedCharging)
{
power.Charging(power.self, Key);
notifiedCharging = true;
}
if (RemainingTime == 0
&& !notifiedReady)
{
@@ -164,7 +164,7 @@ namespace OpenRA.Mods.RA
}
}
}
public void Target()
{
if (!Ready)
@@ -172,7 +172,7 @@ namespace OpenRA.Mods.RA
Manager.self.World.OrderGenerator = Instances.First().OrderGenerator(Key, Manager);
}
public void Activate(Order order)
{
if (!Ready)
@@ -184,13 +184,13 @@ namespace OpenRA.Mods.RA
power.Activate(power.self, order);
RemainingTime = TotalTime;
notifiedCharging = notifiedReady = false;
if (Info.OneShot)
Disabled = true;
}
}
}
public class SelectGenericPowerTarget : IOrderGenerator
{
readonly SupportPowerManager manager;
@@ -208,7 +208,7 @@ namespace OpenRA.Mods.RA
public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
{
world.CancelInputMode();
world.CancelInputMode();
if (mi.Button == expectedButton && world.Map.IsInMap(xy))
yield return new Order(order, manager.self, false) { TargetLocation = xy };
}
@@ -219,7 +219,7 @@ namespace OpenRA.Mods.RA
if (!manager.Powers.ContainsKey(order))
world.CancelInputMode();
}
public void RenderBeforeWorld(WorldRenderer wr, World world) { }
public void RenderAfterWorld(WorldRenderer wr, World world) { }
public string GetCursor(World world, int2 xy, MouseInput mi) { return world.Map.IsInMap(xy) ? cursor : "generic-blocked"; }