Rename existing activity states

This commit is contained in:
Oliver Brakmann
2016-12-06 22:24:39 +01:00
parent bd3639e81d
commit 683d3e747b
6 changed files with 94 additions and 94 deletions

View File

@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Activities
{
public abstract class HarvesterDockSequence : Activity
{
protected enum State { Wait, Turn, Dock, Loop, Undock, Complete }
protected enum DockingState { Wait, Turn, Dock, Loop, Undock, Complete }
protected readonly Actor Refinery;
protected readonly Harvester Harv;
@@ -30,11 +30,11 @@ namespace OpenRA.Mods.Common.Activities
protected readonly WPos StartDrag;
protected readonly WPos EndDrag;
protected State dockingState;
protected DockingState dockingState;
public HarvesterDockSequence(Actor self, Actor refinery, int dockAngle, bool isDragRequired, WVec dragOffset, int dragLength)
{
dockingState = State.Turn;
dockingState = DockingState.Turn;
Refinery = refinery;
DockAngle = dockAngle;
IsDragRequired = isDragRequired;
@@ -49,25 +49,25 @@ namespace OpenRA.Mods.Common.Activities
{
switch (dockingState)
{
case State.Wait:
case DockingState.Wait:
return this;
case State.Turn:
dockingState = State.Dock;
case DockingState.Turn:
dockingState = DockingState.Dock;
if (IsDragRequired)
return ActivityUtils.SequenceActivities(new Turn(self, DockAngle), new Drag(self, StartDrag, EndDrag, DragLength), this);
return ActivityUtils.SequenceActivities(new Turn(self, DockAngle), this);
case State.Dock:
case DockingState.Dock:
if (Refinery.IsInWorld && !Refinery.IsDead)
foreach (var nd in Refinery.TraitsImplementing<INotifyDocking>())
nd.Docked(Refinery, self);
return OnStateDock(self);
case State.Loop:
case DockingState.Loop:
if (!Refinery.IsInWorld || Refinery.IsDead || Harv.TickUnload(self, Refinery))
dockingState = State.Undock;
dockingState = DockingState.Undock;
return this;
case State.Undock:
case DockingState.Undock:
return OnStateUndock(self);
case State.Complete:
case DockingState.Complete:
if (Refinery.IsInWorld && !Refinery.IsDead)
foreach (var nd in Refinery.TraitsImplementing<INotifyDocking>())
nd.Undocked(Refinery, self);
@@ -83,7 +83,7 @@ namespace OpenRA.Mods.Common.Activities
public override bool Cancel(Actor self)
{
dockingState = State.Undock;
dockingState = DockingState.Undock;
return base.Cancel(self);
}