Exemplo n.º 1
0
        public string GetToken()
        {
            var gameConfigSerializer = new GamesConfigurationSerializer();
            var gameConfiguration    = gameConfigSerializer.GetConfiguration(_gameType, _universum);

            return(gameConfiguration.Token);
        }
        private void LoadGamesConfigrations()
        {
            var configSerializer = new GamesConfigurationSerializer();

            GamesConfugurations       = configSerializer.GetConfigurations();
            SelectedGameConfuguration = GamesConfugurations.FirstOrDefault();
            GameTypes = Enum.GetValues(typeof(GameType)).Cast <GameType>().ToList();
        }
Exemplo n.º 3
0
        public void SaveToken(string token)
        {
            var gameConfigSerializer = new GamesConfigurationSerializer();
            var gameConfiguration    = gameConfigSerializer.GetConfiguration(_gameType, _universum);

            gameConfiguration.Token = token;
            gameConfigSerializer.AddConfiguration(gameConfiguration);
        }
        private void DeleteConfiguration()
        {
            var messageBoxResult = MessageBox.Show("Are you sure you want to delete the" + SelectedGameType + " Uniwersum " + Universum + " configuration?",
                                                   "Change configuration", MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                var configSerializer = new GamesConfigurationSerializer();
                configSerializer.DeleteConfiguration(SelectedGameConfuguration);
                LoadGamesConfigrations();
            }
        }
Exemplo n.º 5
0
        private void GetAvailableGamesConfigurations()
        {
            var configSerializer = new GamesConfigurationSerializer();

            try
            {
                GameConfigurationNames = new ObservableCollection <string>(configSerializer.GetConfigurationsNames());
            }
            catch (Exception e)
            {
                MessageBox.Show("error during loading configuration");
            }
        }
        private void AddOrEditConfiguration()
        {
            var messageBoxResult = MessageBox.Show("Are you sure you want to add/save the " + SelectedGameType + " Uniwersum " + Universum + " configuration?",
                                                   "Change configuration", MessageBoxButton.YesNo);

            if (messageBoxResult == MessageBoxResult.Yes)
            {
                var gameConfiguration = new GameConfigurationModel();
                gameConfiguration.GameType       = SelectedGameType;
                gameConfiguration.Login          = Login;
                gameConfiguration.BaseUri        = "whatever";
                gameConfiguration.Universum      = Universum;
                gameConfiguration.SpyProbeAmount = SpyProbeAmount;
                gameConfiguration.CurrentPlanet  = "1";
                gameConfiguration.Token          = "token";

                var configSerializer = new GamesConfigurationSerializer();
                configSerializer.AddConfiguration(gameConfiguration);
                LoadGamesConfigrations();
            }
        }
Exemplo n.º 7
0
        private void UpdateActualGameConfiguration(string configurationName)
        {
            var gameConfigSerializer = new GamesConfigurationSerializer();

            ActualGameConfigurationModel = gameConfigSerializer.GetConfiguration(configurationName);
        }
Exemplo n.º 8
0
        private GameConfigurationModel GetGameConfiguration(string gameConfigurationName)
        {
            var serializer = new GamesConfigurationSerializer();

            return(serializer.GetConfiguration(gameConfigurationName));
        }