Esempio n. 1
0
        public ChessBoard(GameMainWindow gameMainWindow, ChessPiece chessPiece)
        {
            this.gameMainWindow = gameMainWindow;
            this.chessPiece     = chessPiece;

            buttonToGrid = new Dictionary <Button, Grid>();
            grids        = new Grid[11, 10];
        }
        public GameHallWindow()
        {
            InitializeComponent();
            InitializeSeatButtons();
            menuWindow = new MenuWindow();
            menuWindow.ShowDialog();
            gameMainWindow = new GameMainWindow(this);
            gameHall       = new GameHall(this);

            showGameMainWindow = false;
            seatNumber         = 0;
        }
        private void Window_Closing(object sender, CancelEventArgs e)
        {
            gameHallWindow.NotTakenSeatStyle(gameHallWindow.MySeatButton);
            if (readyButton.Visibility == Visibility.Visible || closeForWin == true)
            {
                gameHallWindow.GameHallInfo.GameHallClientInfo.SendData("SEAT|" + gameHallWindow.SeatNumber.ToString() + "|0");
            }
            else
            {
                gameHallWindow.GameHallInfo.GameHallClientInfo.SendData("LOST|" + gameHallWindow.SeatNumber.ToString() + "|" + gameHallWindow.OddOrEven);
                gameHallWindow.NotTakenSeatStyle(gameHallWindow.MySeatButton);
            }

            gameHallWindow.ShowGameMainWindow = false;
            gameHallWindow.SeatNumber         = 0;
            GameMainWindow gmw = new GameMainWindow(gameHallWindow);

            gameHallWindow.GameMainWindowInfo = gmw;
            gameMain.GameMainWindowInfo       = gmw;
        }
Esempio n. 4
0
 public ChessPiece(GameMainWindow gameMainWindow)
 {
     redPieceButtons     = new Dictionary <string, Button>();
     blackPieceButtons   = new Dictionary <string, Button>();
     this.gameMainWindow = gameMainWindow;
 }
Esempio n. 5
0
 public GameMain(GameMainWindow gameMainWindow, GameHallWindow gameHallWindow)
 {
     this.gameMainWindow = gameMainWindow;
     this.gameHallWindow = gameHallWindow;
 }