CanTargetUnit -> CanTargetUnit

This commit is contained in:
Chris Forbes
2010-12-27 18:43:32 +13:00
parent 24a5b3ba03
commit 59fdbe8725
12 changed files with 17 additions and 16 deletions

View File

@@ -140,7 +140,7 @@ namespace OpenRA.Orders
string cursor = null;
if( underCursor != null )
if (o.Order.CanTargetUnit(self, underCursor, mi.Modifiers.HasModifier(Modifiers.Ctrl), mi.Modifiers.HasModifier(Modifiers.Alt), mi.Modifiers.HasModifier(Modifiers.Shift), ref cursor))
if (o.Order.CanTargetActor(self, underCursor, mi.Modifiers.HasModifier(Modifiers.Ctrl), mi.Modifiers.HasModifier(Modifiers.Alt), mi.Modifiers.HasModifier(Modifiers.Shift), ref cursor))
return new UnitOrderResult( self, o.Order, o.Trait, cursor, Target.FromActor( underCursor ) );
if (o.Order.CanTargetLocation(self, xy, actorsAt, mi.Modifiers.HasModifier(Modifiers.Ctrl), mi.Modifiers.HasModifier(Modifiers.Alt), mi.Modifiers.HasModifier(Modifiers.Shift), ref cursor))
return new UnitOrderResult( self, o.Order, o.Trait, cursor, Target.FromCell( xy ) );

View File

@@ -46,7 +46,7 @@ namespace OpenRA.Traits
{
string OrderID { get; }
int OrderPriority { get; }
bool CanTargetUnit( Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueue, ref string cursor );
bool CanTargetActor( Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueue, ref string cursor );
bool CanTargetLocation(Actor self, int2 location, List<Actor> actorsAtLocation, bool forceAttack, bool forceQueue, bool forceMove, ref string cursor);
bool IsQueued { get; }
}

View File

@@ -130,7 +130,7 @@ namespace OpenRA.Mods.RA.Air
public string OrderID { get { return "Move"; } }
public int OrderPriority { get { return 4; } }
public bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
return false;
}

View File

@@ -236,7 +236,7 @@ namespace OpenRA.Mods.RA
public string OrderID { get; private set; }
public int OrderPriority { get; private set; }
public bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
IsQueued = forceQueued;

View File

@@ -61,9 +61,9 @@ namespace OpenRA.Mods.RA
{
}
public override bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
if( !base.CanTargetUnit( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false;
if( !base.CanTargetActor( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false;
IsQueued = forceQueued;

View File

@@ -206,7 +206,7 @@ namespace OpenRA.Mods.RA
public string OrderID { get { return "Harvest";}}
public int OrderPriority { get { return 10; } }
public bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
return false;
}

View File

@@ -153,7 +153,7 @@ namespace OpenRA.Mods.RA
public string OrderID { get { return "BeginMinefield"; } }
public int OrderPriority { get { return 5; } }
public bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
return false;
}

View File

@@ -377,7 +377,8 @@ namespace OpenRA.Mods.RA.Move
public string OrderID { get { return "Move"; } }
public int OrderPriority { get { return 4; } }
public bool IsQueued { get; protected set; }
public bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
return false;
}

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Orders
public string OrderID { get; private set; }
public int OrderPriority { get; private set; }
public bool CanTargetUnit( Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor )
public bool CanTargetActor( Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor )
{
IsQueued = forceQueued;
cursor = useDeployCursor() ? "deploy" : "deploy-blocked";

View File

@@ -25,9 +25,9 @@ namespace OpenRA.Mods.RA.Orders
this.useEnterCursor = useEnterCursor;
}
public override bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
if( !base.CanTargetUnit( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false;
if( !base.CanTargetActor( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false;
if( !canTarget( target ) ) return false;
cursor = useEnterCursor(target) ? "enter" : "enter-blocked";
IsQueued = forceQueued;

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Orders
public string OrderID { get; private set; }
public int OrderPriority { get; private set; }
public virtual bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public virtual bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
if( self == null ) throw new ArgumentNullException( "self" );
if( target == null ) throw new ArgumentNullException( "target" );
@@ -61,9 +61,9 @@ namespace OpenRA.Mods.RA.Orders
{
}
public override bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public override bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
if( !base.CanTargetUnit( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false;
if( !base.CanTargetActor( self, target, forceAttack, forceMove, forceQueued, ref cursor ) ) return false;
if( !target.HasTrait<T>() ) return false;
IsQueued = forceQueued;

View File

@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA
public string OrderID { get { return "SetRallyPoint"; } }
public int OrderPriority { get { return 0; } }
public bool CanTargetUnit(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
public bool CanTargetActor(Actor self, Actor target, bool forceAttack, bool forceMove, bool forceQueued, ref string cursor)
{
return false;
}