private void PerformDocking(GenericShip hostShip, GenericShip dockedShip) { Roster.DockShip("ShipId:" + dockedShip.ShipId); hostShip.DockedShips.Add(dockedShip); dockedShip.DockingHost = hostShip; dockedShip.Model.SetActive(false); hostShip.ToggleDockedModel(dockedShip, true); dockedShip.CallDocked(hostShip); hostShip.CallAnotherShipDocked(dockedShip); hostShip.OnShipIsDestroyed += CheckForcedUndocking; // OLD if (Editions.Edition.Current is Editions.SecondEdition) { hostShip.OnCheckSystemsAbilityActivation += CheckUndockAvailability; hostShip.OnSystemsAbilityActivation += RegisterAskUndockSE; } else { hostShip.OnMovementFinish += RegisterAskUndockFE; } }
private void DockShip(GenericShip docked, GenericShip host) { if (host != null && docked != null) { Roster.DockShip("ShipId:" + docked.ShipId); host.DockedShips.Add(docked); docked.Host = host; docked.Model.SetActive(false); host.ToggleDockedModel(docked, true); docked.CallDocked(host); host.OnMovementFinish += RegisterAskUndock; } }
//old private void PerformDockingOld(GenericShip docked, GenericShip host) { if (host != null && docked != null) { Roster.DockShip("ShipId:" + docked.ShipId); host.DockedShips.Add(docked); docked.DockingHost = host; docked.Model.SetActive(false); host.ToggleDockedModel(docked, true); docked.CallDocked(host); host.CallAnotherShipDocked(docked); host.OnMovementFinish += RegisterAskUndockFE; host.OnShipIsDestroyed += CheckForcedUndocking; } }
private void DockShips() { foreach (var dockedShipsPair in dockedShipsPairs) { GenericShip docked = dockedShipsPair.Key(); GenericShip host = dockedShipsPair.Value(); if (host != null && docked != null) { Roster.HideShip("ShipId:" + docked.ShipId); host.DockedShips.Add(docked); docked.Host = host; docked.Model.SetActive(false); docked.CallDocked(host); host.OnMovementFinish += RegisterAskUndock; } } }