fix newlines in source files

This commit is contained in:
Chris Forbes
2011-09-17 11:26:17 +12:00
parent 9480846250
commit 776a1aa817
7 changed files with 106 additions and 106 deletions

View File

@@ -1,43 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OpenRA.Traits.Activities
{
public abstract class Activity
{
public Activity NextActivity { get; set; }
protected bool IsCanceled { get; private set; }
public abstract Activity Tick( Actor self );
public virtual void Cancel( Actor self )
{
IsCanceled = true;
NextActivity = null;
}
public virtual void Queue( Activity activity )
{
if( NextActivity != null )
NextActivity.Queue( activity );
else
NextActivity = activity;
}
public virtual IEnumerable<Target> GetTargets( Actor self )
{
yield break;
}
}
public static class ActivityExts
{
public static IEnumerable<Target> GetTargetQueue( this Actor self )
{
return self.GetCurrentActivity().Iterate( u => u.NextActivity ).TakeWhile( u => u != null )
.SelectMany( u => u.GetTargets( self ) );
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace OpenRA.Traits.Activities
{
public abstract class Activity
{
public Activity NextActivity { get; set; }
protected bool IsCanceled { get; private set; }
public abstract Activity Tick( Actor self );
public virtual void Cancel( Actor self )
{
IsCanceled = true;
NextActivity = null;
}
public virtual void Queue( Activity activity )
{
if( NextActivity != null )
NextActivity.Queue( activity );
else
NextActivity = activity;
}
public virtual IEnumerable<Target> GetTargets( Actor self )
{
yield break;
}
}
public static class ActivityExts
{
public static IEnumerable<Target> GetTargetQueue( this Actor self )
{
return self.GetCurrentActivity().Iterate( u => u.NextActivity ).TakeWhile( u => u != null )
.SelectMany( u => u.GetTargets( self ) );
}
}
}

View File

@@ -78,12 +78,12 @@ namespace OpenRA.Traits
/* apply the damage modifiers, if we have any. */
var modifier = (float)self.TraitsImplementing<IDamageModifier>()
.Concat(self.Owner.PlayerActor.TraitsImplementing<IDamageModifier>())
.Select(t => t.GetDamageModifier(attacker, warhead)).Product();
.Select(t => t.GetDamageModifier(attacker, warhead)).Product();
if (!ignoreModifiers)
if (!ignoreModifiers)
damage = damage > 0 ? (int)(damage * modifier) : damage;
hp = Exts.Clamp(hp - damage, 0, MaxHP);
hp = Exts.Clamp(hp - damage, 0, MaxHP);
var ai = new AttackInfo
{

View File

@@ -6,14 +6,14 @@
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using OpenRA.FileFormats;
using OpenRA.GameRules;
using OpenRA.Graphics;
#endregion
using System;
using System.Collections.Generic;
using System.Drawing;
using OpenRA.FileFormats;
using OpenRA.GameRules;
using OpenRA.Graphics;
using OpenRA.Network;
namespace OpenRA.Traits
@@ -83,7 +83,7 @@ namespace OpenRA.Traits
}
public interface IVisibilityModifier { bool IsVisible(Actor self); }
public interface IRadarColorModifier { Color RadarColorOverride(Actor self); }
public interface IRadarColorModifier { Color RadarColorOverride(Actor self); }
public interface IHasLocation { int2 PxPosition { get; } }
public interface IOccupySpace : IHasLocation
@@ -128,8 +128,8 @@ namespace OpenRA.Traits
void SetPosition(Actor self, int2 cell);
void SetPxPosition(Actor self, int2 px);
void AdjustPxPosition(Actor self, int2 px); /* works like SetPxPosition, but visual only */
}
}
public interface IMove : ITeleportable { int Altitude { get; set; } }
public interface IFacing

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;
public Rearm(Actor self)
readonly LimitedAmmo limitedAmmo;
int ticksPerPip = 25 * 2;
int remainingTicks = 25 * 2;
public Rearm(Actor self)
{
limitedAmmo = self.TraitOrDefault<LimitedAmmo>();
if (limitedAmmo != null)
ticksPerPip = limitedAmmo.ReloadTimePerAmmo();
remainingTicks = ticksPerPip;
if (limitedAmmo != null)
ticksPerPip = limitedAmmo.ReloadTimePerAmmo();
remainingTicks = ticksPerPip;
}
public override Activity Tick(Actor self)

View File

@@ -1,38 +1,38 @@
#region Copyright & License Information
#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
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
using System.Collections.Generic;
using OpenRA.Traits;
using OpenRA.Traits.Activities;
namespace OpenRA.Mods.RA.Air
{
public class FlyCircle : Activity
{
public override Activity Tick(Actor self)
{
var cruiseAltitude = self.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
if (IsCanceled) return NextActivity;
var aircraft = self.Trait<Aircraft>();
var desiredFacing = aircraft.Facing + 64; // we can't possibly turn this fast.
if (aircraft.Altitude == cruiseAltitude)
aircraft.Facing = Util.TickFacing(aircraft.Facing, desiredFacing, aircraft.ROT);
if (aircraft.Altitude < cruiseAltitude)
++aircraft.Altitude;
FlyUtil.Fly(self, cruiseAltitude);
return this;
}
}
}
*/
#endregion
using System.Collections.Generic;
using OpenRA.Traits;
using OpenRA.Traits.Activities;
namespace OpenRA.Mods.RA.Air
{
public class FlyCircle : Activity
{
public override Activity Tick(Actor self)
{
var cruiseAltitude = self.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
if (IsCanceled) return NextActivity;
var aircraft = self.Trait<Aircraft>();
var desiredFacing = aircraft.Facing + 64; // we can't possibly turn this fast.
if (aircraft.Altitude == cruiseAltitude)
aircraft.Facing = Util.TickFacing(aircraft.Facing, desiredFacing, aircraft.ROT);
if (aircraft.Altitude < cruiseAltitude)
++aircraft.Altitude;
FlyUtil.Fly(self, cruiseAltitude);
return this;
}
}
}

View File

@@ -6,11 +6,11 @@
* as published by the Free Software Foundation. For more information,
* see COPYING.
*/
#endregion
#endregion
using System.Drawing;
using System.Linq;
using OpenRA.Mods.RA.Activities;
using System.Linq;
using OpenRA.Mods.RA.Activities;
using OpenRA.Traits;
namespace OpenRA.Mods.RA.Air
@@ -71,8 +71,8 @@ namespace OpenRA.Mods.RA.Air
self.CancelActivity();
self.QueueActivity(new HeliFly(order.TargetActor.Trait<IHasLocation>().PxPosition + offset));
self.QueueActivity(new Turn(Info.InitialFacing));
self.QueueActivity(new HeliLand(false));
self.QueueActivity(new HeliLand(false));
QueueResupplyActivities(order.TargetActor);
}

View File

@@ -23,8 +23,8 @@ namespace OpenRA.Mods.RA
}
public class LimitedAmmo : INotifyAttack, IPips, ISync
{
[Sync]
{
[Sync]
int ammo;
LimitedAmmoInfo Info;