public SinglePlayer() { InitializeComponent(); this.singlePlayerGameViewModel = new SinglePlayerGameViewModel (new SinglePlayerGameModel(), new SettingsModel()); this.DataContext = this.singlePlayerGameViewModel; }
public SinglePlayerGameMaze(String numOfRows, String numOfCols, String nameOfMaze) { InitializeComponent(); this.spViewModel = new SinglePlayerGameViewModel (new SinglePlayerGameModel(), new SettingsModel()); this.DataContext = this.spViewModel; this.spViewModel.StartNewGame(numOfRows, numOfCols, nameOfMaze); }
/// <summary> /// Initializes a new instance of the <see cref="SinglePlayerGameWindow"/> class. /// </summary> /// <param name="model">The model.</param> public SinglePlayerGameWindow(SingleClientModel model) { spgVM = new SinglePlayerGameViewModel(model); spgVM.FinishGameHappend += FinishGame; spgVM.SolveAnimationFinishedHappend += SolveMessege; DataContext = spgVM; InitializeComponent(); }
/// <summary> /// Constructor. /// </summary> public SinglePlayerMenu() { InitializeComponent(); //Initialize members. settingsModel = new SettingsModel(); this.singlePlayerGameViewModel = new SinglePlayerGameViewModel (new SinglePlayerGameModel(settingsModel), new SettingsViewModel(settingsModel)); //Set data context. this.DataContext = this.singlePlayerGameViewModel; }
/// <summary> /// Constructor. /// </summary> /// <param name="numOfRows">Rows.</param> /// <param name="numOfCols">Columns.</param> /// <param name="nameOfMaze">Maze name.</param> public SinglePlayerGameMaze(String numOfRows, String numOfCols, String nameOfMaze) { //Set members. this.gameName = nameOfMaze; this.communicationClient = new CommunicationClient(); ISettingsModel settingsModel = new SettingsModel(); this.communicationClient.Connect(settingsModel.Port, settingsModel.IpAddress); this.spViewModel = new SinglePlayerGameViewModel (new SinglePlayerGameModel(settingsModel), new SettingsViewModel(settingsModel)); this.spViewModel.ConnectionLost += HandleConnectionLost; this.spViewModel.StartNewGame(numOfRows, numOfCols, nameOfMaze); this.DataContext = this.spViewModel; this.spViewModel.EnableCalled += HandleEnable; }