private PositionEditorForm(ChessFacade chessFacade) { InitializeComponent(); m_chessFacade = chessFacade; m_graphicHandler = new BasicDesign(m_pictureBoxBoard); m_pictureBoxWhiteKing.Image = m_graphicHandler.PieceImage(Piece.WhiteKing); m_pictureBoxWhiteQueen.Image = m_graphicHandler.PieceImage(Piece.WhiteQueen); m_pictureBoxWhiteRook.Image = m_graphicHandler.PieceImage(Piece.WhiteRook); m_pictureBoxWhiteBishop.Image = m_graphicHandler.PieceImage(Piece.WhiteBishop); m_pictureBoxWhiteKnight.Image = m_graphicHandler.PieceImage(Piece.WhiteKnight); m_pictureBoxWhitePawn.Image = m_graphicHandler.PieceImage(Piece.WhitePawn); m_pictureBoxBlackKing.Image = m_graphicHandler.PieceImage(Piece.BlackKing); m_pictureBoxBlackQueen.Image = m_graphicHandler.PieceImage(Piece.BlackQueen); m_pictureBoxBlackRook.Image = m_graphicHandler.PieceImage(Piece.BlackRook); m_pictureBoxBlackBishop.Image = m_graphicHandler.PieceImage(Piece.BlackBishop); m_pictureBoxBlackKnight.Image = m_graphicHandler.PieceImage(Piece.BlackKnight); m_pictureBoxBlackPawn.Image = m_graphicHandler.PieceImage(Piece.BlackPawn); m_comboEnPassant.Items.Add(Square.None); for (Square square = Square.A4; square <= Square.H5; ++square) { m_comboEnPassant.Items.Add(square); } SetEditorPiece(Piece.None); m_positionEditor = m_chessFacade.PositionEditor; m_positionEditor.BoardChanged += HandleBoardChangedEvent; UpdateInterface(); }
public MainApp() { m_thisRef = this; m_graphicHandlerRef = GraphicHandler.getInstance(); m_graphicHandlerRef.setGameInstance(ref m_thisRef); Content.RootDirectory = "Content"; }
public MainForm() { InitializeComponent(); m_panelFont = new Font(FontFamily.GenericSerif, 16, FontStyle.Regular); m_whiteBrush = new SolidBrush(Color.White); m_blackBrush = new SolidBrush(Color.Black); pictureWhiteTime.Image = new Bitmap(pictureWhiteTime.Width - 4, pictureWhiteTime.Height - 4); pictureBlackTime.Image = new Bitmap(pictureBlackTime.Width - 4, pictureBlackTime.Height - 4); pictureStateMessages.Image = new Bitmap(pictureStateMessages.Width - 4, pictureStateMessages.Height - 4); m_whiteTimeGraphic = Graphics.FromImage(pictureWhiteTime.Image); m_blackTimeGraphic = Graphics.FromImage(pictureBlackTime.Image); m_messagesGraphic = Graphics.FromImage(pictureStateMessages.Image); m_chessFacade = new ChessFacade(); m_graphicHandler = new BasicDesign(boardPicture); m_chessFacade.BoardChanged += HandleBoardChangedEvent; m_chessFacade.WhitePawnPromoted += HandleWhitePawnPromotedEvent; m_chessFacade.BlackPawnPromoted += HandleBlackPawnPromotedEvent; m_chessFacade.StatusInfo += HandleStateChangedEvent; m_chessFacade.WhiteClockNotifier += HandleWhiteTimeEvent; m_chessFacade.BlackClockNotifier += HandleBlackTimeEvent; OutputWriter.WriteOutput += HandleWriteOutput; m_chessFacade.RaiseEvents(); m_chessFacade.LoadOpeningBook(); }
static public void setDeviceHandler(ref GraphicHandler handler) { m_deviceHandlerRef = handler; }
static public void setGraphicHandler(ref GraphicHandler handler) { m_graphicHandlerRef = handler; }
virtual protected void Awake() { startingPos = gameObject.transform.position; _spriteManager = gameObject.GetComponentInChildren <SpriteManager>(); _graphicHandler = gameObject.GetComponent <GraphicHandler>(); }