Simplify IDockHost interface
This commit is contained in:
@@ -41,7 +41,8 @@ namespace OpenRA.Mods.Common.Activities
|
||||
|
||||
bool dockInitiated = false;
|
||||
|
||||
public GenericDockSequence(Actor self, DockClientManager client, Actor hostActor, IDockHost host)
|
||||
public GenericDockSequence(Actor self, DockClientManager client, Actor hostActor, IDockHost host,
|
||||
int dockWait, bool isDragRequired, WVec dragOffset, int dragLength)
|
||||
{
|
||||
dockingState = DockingState.Drag;
|
||||
|
||||
@@ -54,17 +55,12 @@ namespace OpenRA.Mods.Common.Activities
|
||||
DockHostSpriteOverlay = hostActor.TraitOrDefault<WithDockingOverlay>();
|
||||
notifyDockHosts = hostActor.TraitsImplementing<INotifyDockHost>().ToArray();
|
||||
|
||||
if (host is IDockHostDrag sequence)
|
||||
{
|
||||
IsDragRequired = sequence.IsDragRequired;
|
||||
DragLength = sequence.DragLength;
|
||||
StartDrag = self.CenterPosition;
|
||||
EndDrag = hostActor.CenterPosition + sequence.DragOffset;
|
||||
}
|
||||
else
|
||||
IsDragRequired = false;
|
||||
IsDragRequired = isDragRequired;
|
||||
DragLength = dragLength;
|
||||
StartDrag = self.CenterPosition;
|
||||
EndDrag = hostActor.CenterPosition + dragOffset;
|
||||
|
||||
QueueChild(new Wait(host.DockWait));
|
||||
QueueChild(new Wait(dockWait));
|
||||
}
|
||||
|
||||
public override bool Tick(Actor self)
|
||||
|
||||
Reference in New Issue
Block a user