Beispiel #1
0
 private void DeselectPenguin()
 {
     if (selectedPenguin != null)
     {
         selectedPenguin.IsSelected = false;
         selectedPenguin = null;
     }
 }
Beispiel #2
0
        public void SelectTile(Tile tile)
        {
            if (tile.Penguin == 1)
            {
                DeselectPenguin();
                selectedPenguin = tile;
                tile.IsSelected = true;
            }
            else if (selectedPenguin != null /*tile.CanMoveToHere*/)
            {
                selectedPenguin.Penguin = 0;
                Tiles.Remove(selectedPenguin);
                DeselectPenguin();
                tile.Penguin = 1;
                BlueScore += tile.Fish;

                // Computer's turn!
                PlayComputerMove();

                RemoveDeadPenguins();

                // If neither player can move, end the game.

                // TODO: Remove tiles that are not connected to any other tile.

                // TODO: Remove solve results.

            }
            else
            {
                DeselectPenguin();
            }
        }