コード例 #1
0
 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);
 }
コード例 #2
0
 public PlayerTurn(MemoryGrid currentGrid, string player1Name, string player2Name)
 {
     InitializeComponent();
     SetPlayerNames(player1Name, player2Name);
     turnFrame.Content         = player1Name;
     currentGrid.OnPlayerTurn += new EventHandler <bool>(UpdateTurnLabel);
 }
コード例 #3
0
 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);
 }
コード例 #4
0
 public PowerUp(MemoryGrid currentGrid, Game currentGame)
 {
     InitializeComponent();
     InitializePlayerNames(currentGame);
     if (currentGame.Date != new DateTime())
     {
         RestoreLoadGame(currentGame);
     }
     currentGrid.OnPowerUpUpdate += new EventHandler <Dictionary <string, int> >(HandlePowerUp);
 }
コード例 #5
0
        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();
            }
        }