public PlayerTurn(MemoryGrid currentGrid, Game loadGame) { InitializeComponent(); SetPlayerNames(loadGame.Player1.Name, loadGame.Player2.Name); turnFrame.Content = (loadGame.Player1.IsMyTurn) ? loadGame.Player1.Name : loadGame.Player2.Name; currentGrid.OnPlayerTurn += new EventHandler <bool>(UpdateTurnLabel); }
public PlayerTurn(MemoryGrid currentGrid, string player1Name, string player2Name) { InitializeComponent(); SetPlayerNames(player1Name, player2Name); turnFrame.Content = player1Name; currentGrid.OnPlayerTurn += new EventHandler <bool>(UpdateTurnLabel); }
private void InitializeGameGrid() { this.grid = new MemoryGrid(GameGridref, currentGame.Grid.GridSize); grid.OnPairMade += new EventHandler <string>(ShowPopup); grid.OnEndGame += new EventHandler <bool>(SaveGame); grid.OnOpenCardClicked += new EventHandler <string>(ShowPopup); grid.OnPowerup += new EventHandler <string>(ShowPopup); }
public PowerUp(MemoryGrid currentGrid, Game currentGame) { InitializeComponent(); InitializePlayerNames(currentGame); if (currentGame.Date != new DateTime()) { RestoreLoadGame(currentGame); } currentGrid.OnPowerUpUpdate += new EventHandler <Dictionary <string, int> >(HandlePowerUp); }
public Scorebord(MemoryGrid currentGrid, Game currentGame) { InitializeComponent(); CurrentGame = currentGame; SetPlayerNames(); currentGrid.OnScore1Update += new EventHandler <int>(UpdateScore1); currentGrid.OnScore2Update += new EventHandler <int>(UpdateScore2); if (CurrentGame.Player1.Score != null) { SetScoresFromLoadedGame(); } }