Example #1
0
    public void Init(ZACommons commons, EventDriver eventDriver,
                     params DockingHandler[] dockingHandlers)
    {
        DockingHandlers = dockingHandlers;
        var docked = ZACommons.IsConnectedAnywhere(commons.Blocks);

        ManageShip(commons, eventDriver, docked);
    }
Example #2
0
    public void Sleep(ZACommons commons, EventDriver eventDriver)
    {
        if (!IsDocked)
        {
            return;
        }

        // Just check if we're still connected
        if (!ZACommons.IsConnectedAnywhere(commons.Blocks))
        {
            // Time to panic and/or wake up
            ManageShip(commons, eventDriver, false);
        }
        else
        {
            eventDriver.Schedule(RunDelay, Sleep);
        }
    }