Exemple #1
0
        protected void checkAttachedSlots()
        {
            List <IHangarMechanic> hangars = this.hangarMgr.getAllHangar();

            foreach (var hangar in hangars)
            {
                HangarLiftSlot liftSlotMech = hangar.getLiftSlotMech();
                liftSlotMech.runActionQueue();

                if (liftSlotMech.hasStopped())
                {
                    // still attached to lift, set command to return back
                    hangar.setReturn();
                    liftSlotMech.reset();
                    return;
                }

                if (liftSlotMech.hasActions())
                {
                    return;
                }
            }

            this.checkAttached = true;
        }
Exemple #2
0
        public void run()
        {
            if (!checkAttached)
            {
                this.checkAttachedSlots();
                return;
            }

            List <IHangarMechanic> hangars = this.hangarMgr.getAllHangar();

            if (!retractingPistons)
            {
                foreach (var hangar in hangars)
                {
                    HangarLiftSlot liftSlotMech = hangar.getLiftSlotMech();
                    liftSlotMech.reset();
                    liftSlotMech.queueAction("setupRetract");
                    //   liftSlotMech.queueAction("mergeOn");
                }
                this.retractingPistons = true;
                return;
            }

            foreach (var hangar in hangars)
            {
                HangarLiftSlot liftSlotMech = hangar.getLiftSlotMech();
                liftSlotMech.runActionQueue();

                if (liftSlotMech.hasStopped())
                {
                    throw new Exception("Hangar lift slot in error state.");
                }

                if (liftSlotMech.hasActions())
                {
                    return;
                }
            }
            this.inReadyState = true;
        }