QueuedActivity's Insert is broken

This commit is contained in:
alzeih
2011-03-18 00:18:57 +13:00
committed by Paul Chote
parent 4e89326134
commit 255bac6aff
64 changed files with 218 additions and 251 deletions

View File

@@ -10,13 +10,12 @@
using System.Collections.Generic;
using OpenRA.Traits;
using OpenRA.Traits.Activities;
namespace OpenRA.Mods.RA.Move
{
public class Drag : IActivity
public class Drag : Activity
{
IActivity NextActivity { get; set; }
int2 endLocation;
int2 startLocation;
int length;
@@ -29,7 +28,7 @@ namespace OpenRA.Mods.RA.Move
}
int ticks = 0;
public IActivity Tick( Actor self )
public override Activity Tick( Actor self )
{
var mobile = self.Trait<Mobile>();
mobile.PxPosition = int2.Lerp(startLocation, endLocation, ticks, length - 1);
@@ -43,19 +42,14 @@ namespace OpenRA.Mods.RA.Move
return this;
}
public void Cancel(Actor self) { }
public void Queue( IActivity activity )
{
if( NextActivity != null )
NextActivity.Queue( activity );
else
NextActivity = activity;
protected override bool OnCancel(Actor self)
{
return false;
}
public IEnumerable<float2> GetCurrentPath()
public override IEnumerable<Target> GetTargetQueue( Actor self )
{
yield return endLocation;
yield return Target.FromPos(endLocation);
}
}
}