IActivity no longer passed Mobiles around.

This commit is contained in:
Bob
2009-11-25 18:18:17 +13:00
parent 2aea110497
commit 5c3da9387b
9 changed files with 26 additions and 23 deletions

View File

@@ -49,9 +49,10 @@ namespace OpenRa.Game.Traits.Activities
return (u == null || u == self);
}
public IActivity Tick( Actor self, Mobile mobile )
public IActivity Tick( Actor self )
{
var unit = self.traits.Get<Unit>();
var mobile = self.traits.Get<Mobile>();
if( move != null )
{
@@ -151,6 +152,12 @@ namespace OpenRa.Game.Traits.Activities
return 0.5f * ( CenterOfCell( from ) + CenterOfCell( to ) );
}
public void Cancel( Actor self )
{
path = new List<int2>();
NextActivity = null;
}
abstract class MovePart
{
public readonly float2 from, to;
@@ -254,11 +261,5 @@ namespace OpenRa.Game.Traits.Activities
return null;
}
}
public void Cancel( Actor self, Mobile mobile )
{
path = new List<int2>();
NextActivity = null;
}
}
}