Example #1
0
        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;
            }
            
        }
Example #2
0
        //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;
            }
        }