/// <summary>
 /// Initializes a new instance of the <see cref="MultiPlayerMenu"/> class.
 /// </summary>
 /// <param name="viewModel">The view model.</param>
 public MultiPlayerMenu(ViewModel viewModel)
 {
     this.viewModel = viewModel;
     viewModel.Send("list");
     this.DataContext = viewModel;
     ifStartPressed   = false;
     GameBegin        = false;
 }
        /// <summary>
        /// Handles the Click event of the Solve_Maze control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="RoutedEventArgs"/> instance containing the event data.</param>
        private void Solve_Maze_Click(object sender, RoutedEventArgs e)
        {
            tick = 0;
            string message = "solve " + Maze.FromJSON(mazeJson).Name + " " + viewModel.VM_SearchAlgorithm;

            solve_button.IsEnabled        = false;
            restart_game_button.IsEnabled = false;
            main_manu_button.IsEnabled    = false;
            viewModel.Send(message);
        }
Пример #3
0
        /// <summary>
        /// Commands the game.
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">The e.</param>
        private void commandGame(object sender, MazeCommand e)
        {
            string message = e.CommandType;

            foreach (string arg in e.args)
            {
                message += " " + arg;
            }
            viewModel.Send(message);
        }
 /// <summary>
 /// Called when [closing].
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="CancelEventArgs"/> instance containing the event data.</param>
 private void OnClosing(object sender, CancelEventArgs e)
 {
     viewModel.Send("close " + viewModel.VM_GameName);
     viewModel.InitializeGame();
 }