Ejemplo n.º 1
0
        public override Magnet[] GetMagnets()
        {
            if (IsStatic)
            {
                return(null);
            }
            var x    = new ScalarExpression(Name, "a", Name + ".x", true);
            var y    = new ScalarExpression(Name, "a", Name + ".y", true);
            var name = Name + "'s ";

            Center = new Magnet(x, y, name + "center");
            Left   = new Magnet(new ScalarExpression(Name, "a", Name + ".x - " + Name + ".radius1", true), y,
                                name + "left radius");
            Right = new Magnet(new ScalarExpression(Name, "a", Name + ".x + " + Name + ".radius1", true), y,
                               name + "right radius");
            Bottom = new Magnet(x, new ScalarExpression(Name, "a", Name + ".y + " + Name + ".radius2", true),
                                name + "bottom radius");
            Top = new Magnet(x, new ScalarExpression(Name, "a", Name + ".y - " + Name + ".radius2", true),
                             name + "top radius");

            return(new[]
            {
                Center,
                Left,
                Right,
                Bottom,
                Top
            });
        }
Ejemplo n.º 2
0
        public override Magnet[] GetMagnets()
        {
            if (IsStatic)
            {
                return(null);
            }
            var w = new ScalarExpression(Name, "a", Name + ".x + " + Name + ".width", true);
            var h = new ScalarExpression(Name, "a", Name + ".y + " + Name + ".height", true);

            var x    = new ScalarExpression(Name, "a", Name + ".x", true);
            var y    = new ScalarExpression(Name, "a", Name + ".y", true);
            var name = Name + "'s ";

            Start  = new Magnet(x, y, name + "start");
            End    = new Magnet(w, h, name + "end");
            Center = new Magnet(new ScalarExpression(Name, "a", Name + ".x + (" + Name + ".width/2)", true),
                                new ScalarExpression(Name, "a", Name + ".y + (" + Name + ".height/2)", true), name + "center");

            return(new[]
            {
                Start,
                End,
                Center
            });
        }
Ejemplo n.º 3
0
        public override Magnet[] GetMagnets()
        {
            if (IsStatic)
            {
                return(null);
            }
            var w      = new ScalarExpression(Name, "a", Name + ".x + " + Name + ".width", true);
            var h      = new ScalarExpression(Name, "a", Name + ".y + " + Name + ".height", true);
            var wover2 = new ScalarExpression(Name, "a", Name + ".x + (" + Name + ".width/2)", true);
            var hover2 = new ScalarExpression(Name, "a", Name + ".y + (" + Name + ".height/2)", true);

            var x    = new ScalarExpression(Name, "a", Name + ".x", true);
            var y    = new ScalarExpression(Name, "a", Name + ".y", true);
            var name = Name + "'s ";

            TopLeft     = new Magnet(x, y, name + "top-left");
            BottomLeft  = new Magnet(x, h, name + "bottom-left");
            TopRight    = new Magnet(w, y, name + "top-right");
            BottomRight = new Magnet(w, h, name + "bottom-right");
            Center      = new Magnet(wover2, hover2, name + "center");
            Left        = new Magnet(x, hover2, name + "left");
            Right       = new Magnet(w, hover2, name + "right");
            Top         = new Magnet(wover2, y, name + "top");
            Bottom      = new Magnet(wover2, h, name + "bottom");

            return(new[]
            {
                TopLeft,
                BottomLeft,
                TopRight,
                BottomRight,
                Center,
                Left,
                Right,
                Top,
                Bottom
            });
        }
Ejemplo n.º 4
0
 public bool EqualExprStrings(Magnet a)
 {
     return((X.ExprString == a.X.ExprString) && (Y.ExprString == a.Y.ExprString));
 }