Ejemplo n.º 1
0
        public GoView()
        {
            cb = new ChessBoard();
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.DoubleBuffer, true);
            InitializeComponent();
            cb.BindLayout(layout);
            mode.BindChessBoard(cb);
//             layout.SetDian(1, 0, GoDianType.BLACK);
//             layout.SetDian(0, 1, GoDianType.BLACK);
//             layout.SetDian(2, 1, GoDianType.BLACK);
//             layout.SetDian(1, 2, GoDianType.BLACK);
//             layout.SetDian(0, 2, GoDianType.WHITE);
//             layout.SetDian(1, 3, GoDianType.WHITE);
//             layout.SetDian(2, 2, GoDianType.WHITE);

            GoStep(layout, 0, 2, GoPointType.BLACK);
            GoStep(layout, 1, 1, GoPointType.BLACK);
            GoStep(layout, 2, 0, GoPointType.BLACK);
            GoStep(layout, 1, 3, GoPointType.BLACK);
            GoStep(layout, 2, 4, GoPointType.BLACK);
            GoStep(layout, 3, 1, GoPointType.BLACK);
            GoStep(layout, 3, 3, GoPointType.BLACK);
            GoStep(layout, 4, 2, GoPointType.BLACK);

            GoStep(layout, 2, 1, GoPointType.WHITE);
            GoStep(layout, 1, 2, GoPointType.WHITE);
            GoStep(layout, 3, 2, GoPointType.WHITE);
            GoStep(layout, 2, 3, GoPointType.WHITE);

            GoStep(layout, 2, 2, GoPointType.WHITE);


//             layout.SetupPoint(new GoCoord(0, 2), GoPointType.BLACK);
//             layout.SetupPoint(new GoCoord(1, 1), GoPointType.BLACK);
//             layout.SetupPoint(new GoCoord(2, 0), GoPointType.BLACK);
//             layout.SetupPoint(new GoCoord(1, 3), GoPointType.BLACK);
//             layout.SetupPoint(new GoCoord(2, 4), GoPointType.BLACK);
//             layout.SetupPoint(new GoCoord(3, 1), GoPointType.BLACK);
//             layout.SetupPoint(new GoCoord(3, 3), GoPointType.BLACK);
//             layout.SetupPoint(new GoCoord(4, 2), GoPointType.BLACK);
//
//             layout.SetupPoint(new GoCoord(2, 1), GoPointType.WHITE);
//             layout.SetupPoint(new GoCoord(1, 2), GoPointType.WHITE);
//             layout.SetupPoint(new GoCoord(3, 2), GoPointType.WHITE);
//             layout.SetupPoint(new GoCoord(2, 3), GoPointType.WHITE);
        }