Ejemplo n.º 1
0
        public MapleRectangle(Board board, SerializationForm json)
            : base(board, 0, 0, 0)
        {
            // Make dots
            a = CreateDot(json.x1, json.y1);
            b = CreateDot(json.x2, json.y1);
            c = CreateDot(json.x2, json.y2);
            d = CreateDot(json.x1, json.y2);

            // Make lines
            ab = CreateLine(a, b);
            bc = CreateLine(b, c);
            cd = CreateLine(c, d);
            da = CreateLine(d, a);
            ab.yBind = true;
            bc.xBind = true;
            cd.yBind = true;
            da.xBind = true;
        }
Ejemplo n.º 2
0
        public MapleEmptyRectangle(Board board, XNA.Rectangle rect)
        {
            this.board = board;

            lock (board.ParentControl)
            {
                a = CreateDot(rect.Left, rect.Top);
                b = CreateDot(rect.Right, rect.Top);
                c = CreateDot(rect.Right, rect.Bottom);
                d = CreateDot(rect.Left, rect.Bottom);
                PlaceDots();

                // Make lines
                ab = CreateLine(a, b);
                bc = CreateLine(b, c);
                cd = CreateLine(c, d);
                da = CreateLine(d, a);
                ab.yBind = true;
                bc.xBind = true;
                cd.yBind = true;
                da.xBind = true;
            }
        }
Ejemplo n.º 3
0
 public static UndoRedoAction LineAdded(MapleLine line, MapleDot a, MapleDot b)
 {
     return new UndoRedoAction(null, UndoRedoType.LineAdded, a, b, line);
 }