void Initalize()
        {
            var positionedWheels = DetectWheels();
            var control          = DetectControls();
            var cockpits         = DetectCockpits();
            var displayPanels    = DetectPanels(cockpits);
            var gyros            = DetectGyroscopes();

            this.ticker = new Ticker();
            this.motor  = new MotorControl(positionedWheels, control);

            this.mainControl    = control;
            this.traveller      = new WaypointTraveller(motor, control, displayPanels[0]);
            this.greedleManager = new GreedleManager(IGC, null);
            this.recorder       = new WaypathRecorder(
                mainControl,
                new Waypath("Default Waypath", new List <Waypoint>()),
                displayPanels[1],
                OnRecorderPathUpdate
                );
            this.pathOutput = displayPanels[2];

            this.commander = new PanelCommander(
                new PanelCommander.CommandTree()
            {
                label    = "Main Menu",
                subtrees = new List <PanelCommander.CommandTree>()
                {
                    traveller.commandTree,
                    greedleManager.commandTree,
                    recorder.commandTree,
                },
                commands = new List <PanelCommander.Command>()
                {
                    new PanelCommander.Command()
                    {
                        label = "Save State to CustomData", action = SaveToData
                    },
                    new PanelCommander.Command()
                    {
                        label = "Load State from CustomData", action = LoadFromData
                    },
                    new PanelCommander.Command()
                    {
                        label = "Set Greedles to Path", action = DeployGreedles
                    },
                    new PanelCommander.Command()
                    {
                        label = "Switch Waypath", action = NextWaypath
                    },
                    new PanelCommander.Command()
                    {
                        label = "New Waypath", action = StartNewWaypath
                    },
                    new PanelCommander.Command()
                    {
                        label = "Delete Waypath", action = RemoveWaypath
                    },
                    new PanelCommander.Command()
                    {
                        label = "Dump Traveller GPS Data to Surface", action = TravellerDump
                    },
                }
            },
                displayPanels[displayPanels.Length - 2]
                );

            Load();
            DrawPaths();
        }
示例#2
0
 public void RegisterTicker(Ticker ticker)
 {
     ticker.Register(this);
     _tickers.Add(ticker);
 }