Example #1
0
        public ClientProtocol(Client client)
        {
            _client = client;

            _settings = new DebugSettings();
            _guiUpdateHandler = new UpdateHandler(_settings.guiUpdateRate);
            _stateUpdateHandler = new UpdateHandler(_settings.stateUpdateRate);

            _windows = null;

            _background = new Task(_requestGui);
        }
Example #2
0
        public Computer()
        {
            modules = new List<Module>();

            attitude = new AttitudeController(this);

            modules.Add(new ASASModule(this));
            modules.Add(new InfoModule(this));
            modules.Add(attitude);

            _switches = new Dictionary<Module, ModuleSwitch>();

            settings = new DebugSettings() { guiUpdateRate = 30f, stateUpdateRate = 30f };

            universe = new Universe();
            vessel = new Vessel(universe);
        }
Example #3
0
        public static DebugSettings requestSetup(Connection connection, Screen screen)
        {
            connection.stream.write("setup");
            screen.serialize(connection.stream);
            connection.flush();

            DebugSettings settings = new DebugSettings();
            settings.deserialize(connection.stream);

            return settings;
        }
Example #4
0
        public void setup(Screen screen)
        {
            _windows = null;

            _settings = Protocol.requestSetup(_connection, screen);
            _guiUpdateHandler = new UpdateHandler(_settings.guiUpdateRate);
            _stateUpdateHandler = new UpdateHandler(_settings.stateUpdateRate);

            _background.wait();
            _background = new Task(() =>
                    {
                        if(_settings.updateGui)
                            _client.execute(() => Protocol.requestGuiUpdate(_windows, _connection));

                        _requestGui();
                    });
        }