Example #1
0
        private void constructor()
        {
            ID              = ComponentsManager.GetFreeID();
            Logics          = new Logics.WireLogics();
            Graphics        = new Graphics.WireGraphics();
            Graphics.parent = this;
            Logics.parent   = this;

            if (J1 != null)
            {
                J1.ConnectedWires.Remove(this);
                J1.ConnectedWires.Add(this);
                J2.ConnectedWires.Remove(this);
                J2.ConnectedWires.Add(this);

                Statistics.WireLengthPlaced +=
                    Math.Sqrt(Math.Pow(J1.Graphics.Position.X - J2.Graphics.Position.X, 2) +
                              Math.Pow(J1.Graphics.Position.Y - J2.Graphics.Position.Y, 2));

                MicroWorld.Logics.CircuitManager.ScheduleReCreate();
            }

            ToolTip = new GUI.WireProperties();
        }
Example #2
0
        private void constructor()
        {
            ID = ComponentsManager.GetFreeID();
            Logics = new Logics.WireLogics();
            Graphics = new Graphics.WireGraphics();
            Graphics.parent = this;
            Logics.parent = this;

            if (J1 != null)
            {
                J1.ConnectedWires.Remove(this);
                J1.ConnectedWires.Add(this);
                J2.ConnectedWires.Remove(this);
                J2.ConnectedWires.Add(this);

                Statistics.WireLengthPlaced +=
                    Math.Sqrt(Math.Pow(J1.Graphics.Position.X - J2.Graphics.Position.X, 2) +
                              Math.Pow(J1.Graphics.Position.Y - J2.Graphics.Position.Y, 2));

                MicroWorld.Logics.CircuitManager.ScheduleReCreate();
            }

            ToolTip = new GUI.WireProperties();
        }