Split out an ActivityUtils class.

This commit is contained in:
Paul Chote
2016-01-14 21:50:11 +00:00
parent e46fc644c1
commit 0039a2bdbf
32 changed files with 120 additions and 98 deletions

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Activities
if (inner == null)
return NextActivity;
inner = Util.RunActivity(self, inner);
inner = ActivityUtils.RunActivity(self, inner);
return this;
}

View File

@@ -41,10 +41,10 @@ namespace OpenRA.Mods.Common.Activities
if (target.IsInRange(self.CenterPosition, maxRange) && !target.IsInRange(self.CenterPosition, minRange))
{
var wait = new WaitFor(() => !target.IsValidFor(self) || target.CenterPosition != cachedPosition);
return Util.SequenceActivities(wait, path, this);
return ActivityUtils.SequenceActivities(wait, path, this);
}
return Util.SequenceActivities(path, this);
return ActivityUtils.SequenceActivities(path, this);
}
}
}

View File

@@ -182,7 +182,7 @@ namespace OpenRA.Mods.Common.Activities
if (firstFacing != mobile.Facing)
{
path.Add(nextCell.Value.First);
return Util.SequenceActivities(new Turn(self, firstFacing), this);
return ActivityUtils.SequenceActivities(new Turn(self, firstFacing), this);
}
else
{

View File

@@ -90,7 +90,7 @@ namespace OpenRA.Mods.Common.Activities
inner.Cancel(self);
self.SetTargetLine(Target.FromCell(self.World, targetPosition), Color.Green);
return Util.RunActivity(self, new AttackMoveActivity(self, mobile.MoveTo(targetPosition, 0)));
return ActivityUtils.RunActivity(self, new AttackMoveActivity(self, mobile.MoveTo(targetPosition, 0)));
}
// Inner move order has completed.
@@ -129,7 +129,7 @@ namespace OpenRA.Mods.Common.Activities
}
// Ticks the inner move activity to actually move the actor.
inner = Util.RunActivity(self, inner);
inner = ActivityUtils.RunActivity(self, inner);
return this;
}