fix newlines in source files
This commit is contained in:
@@ -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 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user