withSIX.Play.Core.Games.Legacy.CalculatedGameSettings.CalculatedGameSettings C# (CSharp) Method

CalculatedGameSettings() public method

public CalculatedGameSettings ( Game game ) : System
game Game
return System
        public CalculatedGameSettings(Game game) {
            _game = game;
            _supportsModding = _game.SupportsMods();
            _supportsMissions = _game.SupportsMissions();
            _supportsServers = _game.SupportsServers();
            if (_supportsModding)
                _modding = _game.Modding();

            Signatures = new string[0];
            if (!Execute.InDesignMode) {
                var collectionChanged = this.WhenAnyValue(x => x.Collection)
                    .Skip(1);
                collectionChanged
                    .Subscribe(HandleModSetSwitch);

                // TODO: Ignore out of band responses, cancel previous etc...
                collectionChanged
                    .ObserveOn(ThreadPoolScheduler.Instance)
                    .Subscribe(x => UpdateSignatures());

                this.WhenAnyValue(x => x.Server)
                    .Skip(1)
                    .Subscribe(HandleServerSwitch);

                this.WhenAnyValue(x => x.Server.Mods)
                    .Skip(1)
                    .Subscribe(HandleServerModsChanged);

                this.WhenAnyValue(x => x.Mission)
                    .Skip(1)
                    .Subscribe(HandleMissionSwitch);
            }

            _first = true;
        }