public void Start(PlayerRepresentation whitePlayer, PlayerRepresentation blackPlayer, PictureBox gameBoard, MenuItem startMenuItem, MenuItem stopMenuItem, Board.BoardSize boardSize) { this.startMenuItem = startMenuItem; this.stopMenuItem = stopMenuItem; startMenuItem.Enabled = false; stopMenuItem.Enabled = true; mouseMoveEvent = new MouseEventHandler(GameBoard_MouseMove); paintEvent = new PaintEventHandler(GameBoard_Paint); mouseLeaveEvent = new EventHandler(GameBoard_MouseLeave); clickEvent = new EventHandler(GameBoard_Click); this.whitePlayer = whitePlayer; this.blackPlayer = blackPlayer; whitePlayer.Start(false); blackPlayer.Start(true); this.gameBoard = gameBoard; Game.Instance.Start(whitePlayer.PlayerName, blackPlayer.PlayerName, boardSize); this.boardSize = (Int32) boardSize; gameBoard.Width = blockSize * ((Int32) boardSize) + (2 * 5); gameBoard.Height = blockSize * ((Int32) boardSize) + (2 * 5); gameBoard.MouseMove += mouseMoveEvent; gameBoard.Paint += paintEvent; gameBoard.MouseLeave += mouseLeaveEvent; gameBoard.Click += clickEvent; gameBoard.Refresh(); }
public PlayerUpdated(string user, PlayerRepresentation player, string championName, ETurnPhases phase) : base(user) { Id = player.PlayerId.GetInstanceId(); Phase = phase; Message = GetMessageName(); Resources = player.TotalResources; Thresholds = player.GetAllThresholds(); ChampionName = championName; }