public SaveHighScoreCommand(ObservableCollection<HighScores> highScores, XML xML, string name, TimeSpan score) { this.highScores = highScores; this.xML = xML; this.name = name; this.score = score; }
public MainViewModel() { XML xml = new XML(); player = xml.Player; players.Add(player); highScores = new ObservableCollection<Model.HighScores>(); highScores.Add(xml.HighScores); highScores[0].players = players; mc = new MovementController(players, highScores); mc.Win += mc_Win; NewHighScoreCommand = new RelayCommand(NewHighScore); KeyDownCommand = new RelayCommand<KeyEventArgs>(KeyDown); KeyUpCommand = new RelayCommand<KeyEventArgs>(KeyUp); NewGameCommand = new RelayCommand(NewGame); ContinueCommand = new RelayCommand(Continue); HighScoreCommand = new RelayCommand(HighScore); ExitCommand = new RelayCommand(Exit); SaveHighScoreCommand = new RelayCommand<String>(SaveHighScore); MainMenuCommand = new RelayCommand(MainMenuC); SavePlayerCommand = new RelayCommand(SavePlayer); NewPlayerCommandLVL1 = new RelayCommand(NewPlayerLVL1); NewPlayerCommandLVL2 = new RelayCommand(NewPlayerLVL2); DeathCommand = new RelayCommand(Death); WinCommand = new RelayCommand(Win); LevelSelectCommand = new RelayCommand(LevelSelectC); }
public void TestPlayerXML() { HighScores high = new HighScores(); Player player = new Player(); XML xml = new XML(); player.alive = false; player.onWallRight = true; xml.Player = player; Assert.Equals(xml.Player.alive, player.alive); Assert.Equals(xml.Player.onWallRight, player.onWallRight); }
public void TestHighScoreXML() { HighScores high = new HighScores(); Player player = new Player(); XML xml= new XML(); high.Name1 = "PLayer 1"; high.Name2 = "PLayer 2"; high.Score1 = long.MaxValue; high.Score2 = long.MinValue; xml.HighScores = high; Assert.AreEqual(xml.HighScores.Name1, high.Name1); Assert.AreEqual(xml.HighScores.Name2, high.Name2); Assert.AreEqual(xml.HighScores.Score1, high.Score1); Assert.AreEqual(xml.HighScores.Score2, high.Score2); Assert.AreEqual(xml.HighScores.Name, high.Name); Assert.AreEqual(xml.HighScores.Score, high.Score); Assert.AreEqual(xml.HighScores.nice1, high.nice1); Assert.AreEqual(xml.HighScores.nice2, high.nice2); }
public ContinueCommand(ObservableCollection<Player> players, XML xML) { this.players = players; this.xML = xML; }