Exemplo n.º 1
0
        public ChessBoard(Context context)
        {
            InitializeComponent();

            boardManager = new BoardManager(context);
            this.komaImageSize = context.Size;
            this.PictureSize = getImageSize();
            ClientSize = new Size(PictureSize * 8, PictureSize * 8);
            createKoma();
        }
Exemplo n.º 2
0
        public Form1()
        {
            InitializeComponent();
            var context =new Context();
            var board = new ChessBoard(context);

            board.Margin = new System.Windows.Forms.Padding(0, 0, 0, 0);
            Text = "Chess";
            //this.Controls.Add(board);
            ClientSize = new Size(board.ClientSize.Width + 50, board.ClientSize.Height) ;
            var panel = new FlowLayoutPanel();
            panel.Size = ClientSize;
            this.Controls.Add(panel);

            panel.Controls.Add(board);
            var pnl2 = createPanel(board.ClientSize.Height,string.Empty);
            panel.Controls.Add(pnl2);
            pnl2.Controls.Add(createPanel(board.ClientSize.Height/2,
                context.Players[PlayerNo.One].PlayerName ));
            pnl2.Controls.Add(createPanel(board.ClientSize.Height / 2,
                context.Players[PlayerNo.Two].PlayerName));

            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
        }
Exemplo n.º 3
0
 public BoardManager(Context context)
 {
     this.context = context;
 }