Esempio n. 1
0
        public SettingsViewModel(NetworkServer server, ITriggerSystem triggerSystem, TimerService timerService, ScoreManager scoreManager, MainViewModel mainView)
        {
            this.timerService = timerService;
            this.server = server;
            this.scoreManager = scoreManager;
            this.mainView = mainView;
            persistencyManager = new PersistencyManager();
            TriggerSystem = triggerSystem;

            SendMessageCommand = new DelegateCommand(SendMessage);
            SendHighscoreCommand = new DelegateCommand(SendHighscore);
            SendOperatorCommand = new DelegateCommand(SendOperator);

            TestCommand = new DelegateCommand(o => SetTestData());
            OpenCommand = new DelegateCommand(o => LoadScore());
            SaveCommand = new DelegateCommand(o => SaveScore());

            ShowTMWindowCommand = new DelegateCommand(o => ShowTimeMeasurementWindow());
            SaveScoreCommand = new DelegateCommand(o => SaveCurrentScore());
            DeleteScoreCommand = new DelegateCommand(o => DeleteScore());
            DiscardScoreCommand = new DelegateCommand(o => DiscardScore());

            ExampleText = "Test";
        }
Esempio n. 2
0
 internal void LoadDefaultScores()
 {
     Console.WriteLine("Loading scores...");
     PersistencyManager p = new PersistencyManager();
     ScoreManager.SetAllScores(p.LoadScores(DEFAULT_SCORE_FILENAME));
 }
Esempio n. 3
0
 internal void SaveDefaultScores()
 {
     PersistencyManager p = new PersistencyManager();
     p.SaveScores(ScoreManager.GetAllScores(), DEFAULT_SCORE_FILENAME);
 }