public override void InitAddChildComponents() { for (int i = 0; i < Joints.Length; i++) { switch (rotation) { case Rotation.cw0: Joints[i] = Joint.GetJoint(new Vector2(JointLocs0cw[i * 2], JointLocs0cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw90: Joints[i] = Joint.GetJoint(new Vector2(JointLocs90cw[i * 2], JointLocs90cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw180: case Rotation.cw270: default: break; } Joints[i].Initialize(); Joints[i].CanRemove = false; Joints[i].ContainingComponents.Add(this); } W = new Wire(Joints[0], Joints[1]); W.Resistance = MaxResistance; W.AddComponentToManager(); W.Graphics.Visible = false; W.Initialize(); }
public override void InitAddChildComponents() { for (int i = 0; i < Joints.Length; i++) { switch (rotation) { case Rotation.cw0: Joints[i] = Joint.GetJoint(new Vector2(JointLocs0cw[i * 2], JointLocs0cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw90: Joints[i] = Joint.GetJoint(new Vector2(JointLocs90cw[i * 2], JointLocs90cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw180: Joints[i] = Joint.GetJoint(new Vector2(JointLocs180cw[i * 2], JointLocs180cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw270: Joints[i] = Joint.GetJoint(new Vector2(JointLocs270cw[i * 2], JointLocs270cw[i * 2 + 1]) + Graphics.Position); break; default: break; } Joints[i].CanRemove = false; Joints[i].ContainingComponents.Add(this); } Joints[2].Graphics.Visible = false; Joints[2].CanBeGround = true; Joints[2].IsGround = true; Joints[2].CanProvidePower = true; Joints[2].IsProvidingPower = false; Joints[3].Graphics.Visible = false; Joints[3].CanProvidePower = true; Joints[3].IsProvidingPower = true; Joints[3].CanBeGround = true; Joints[3].IsGround = false; for (int i = 0; i < Joints.Length; i++) { Joints[i].Initialize(); } W1 = new Wire(Joints[0], Joints[2]); W1.Direction = Wire.WireDirection.J1ToJ2; W1.Resistance = 300; W1.AddComponentToManager(); W1.Graphics.Visible = false; W1.Initialize(); W2 = new Wire(Joints[3], Joints[1]); W2.Direction = Wire.WireDirection.J1ToJ2; W2.Resistance = 5; W2.AddComponentToManager(); W2.Graphics.Visible = false; W2.Initialize(); }
public override void InitAddChildComponents() { for (int i = 0; i < Joints.Length; i++) { Joints[i] = Joint.GetJoint(new Vector2(JointLocs0cw[i * 2], JointLocs0cw[i * 2 + 1]) + Graphics.Position); Joints[i].CanRemove = false; Joints[i].ContainingComponents.Add(this); } Joints[3].Graphics.Visible = false; Joints[3].CanBeGround = true; Joints[3].IsGround = true; Joints[3].CanProvidePower = false; Joints[3].IsProvidingPower = false; Joints[4].Graphics.Visible = false; Joints[4].CanProvidePower = true; Joints[4].IsProvidingPower = true; Joints[4].CanBeGround = false; Joints[4].IsGround = false; Joints[5].Graphics.Visible = false; Joints[5].CanProvidePower = true; Joints[5].IsProvidingPower = false; Joints[5].CanBeGround = false; Joints[5].IsGround = false; for (int i = 0; i < Joints.Length; i++) { Joints[i].Initialize(); } W1 = new Wire(Joints[0], Joints[3]); W1.Direction = Wire.WireDirection.J1ToJ2; W1.Resistance = 300; W1.AddComponentToManager(); W1.Graphics.Visible = false; W1.Initialize(); W2 = new Wire(Joints[5], Joints[1]); W2.Direction = Wire.WireDirection.J1ToJ2; W2.Resistance = 5; W2.AddComponentToManager(); W2.Graphics.Visible = false; W2.Initialize(); W3 = new Wire(Joints[4], Joints[2]); W3.Direction = Wire.WireDirection.J1ToJ2; W3.Resistance = 5; W3.AddComponentToManager(); W3.Graphics.Visible = false; W3.Initialize(); }
public override void InitAddChildComponents() { for (int i = 0; i < Joints.Length; i++) { Joints[i] = Joint.GetJoint(new Vector2(JointLocs0cw[i * 2], JointLocs0cw[i * 2 + 1]) + Graphics.Position); Joints[i].CanRemove = false; Joints[i].ContainingComponents.Add(this); } for (int i = 4; i < Joints.Length; i++) { Joints[i].CanBeGround = true; Joints[i].IsGround = true; Joints[i].Graphics.Visible = false; } for (int i = 0; i < Joints.Length; i++) { Joints[i].Initialize(); } W1 = new Wire(Joints[0], Joints[4]); W1.Resistance = 400; W1.AddComponentToManager(); W1.Graphics.Visible = false; W1.IsRemovable = false; W1.Initialize(); W2 = new Wire(Joints[1], Joints[5]); W2.Resistance = 400; W2.AddComponentToManager(); W2.Graphics.Visible = false; W2.IsRemovable = false; W2.Initialize(); W3 = new Wire(Joints[2], Joints[6]); W3.Resistance = 400; W3.AddComponentToManager(); W3.Graphics.Visible = false; W3.IsRemovable = false; W3.Initialize(); W4 = new Wire(Joints[3], Joints[7]); W4.Resistance = 400; W4.AddComponentToManager(); W4.Graphics.Visible = false; W4.IsRemovable = false; W4.Initialize(); }
public override void InitAddChildComponents() { for (int i = 0; i < Joints.Length; i++) { Joints[i] = Joint.GetJoint(new Vector2(JointLocs0cw[i * 2], JointLocs0cw[i * 2 + 1]) + Graphics.Position); Joints[i].Initialize(); Joints[i].CanRemove = false; Joints[i].ContainingComponents.Add(this); } W = new Wire(Joints[0], Joints[1]); W.Direction = Wire.WireDirection.J1ToJ2; W.Resistance = 1; W.AddComponentToManager(); W.Graphics.Visible = false; W.Initialize(); }
public override void InitAddChildComponents() { for (int i = 0; i < Joints.Length; i++) { switch (rotation) { case Rotation.cw0: Joints[i] = Joint.GetJoint(new Vector2(JointLocs0cw[i * 2], JointLocs0cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw90: Joints[i] = Joint.GetJoint(new Vector2(JointLocs90cw[i * 2], JointLocs90cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw180: Joints[i] = Joint.GetJoint(new Vector2(JointLocs180cw[i * 2], JointLocs180cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw270: Joints[i] = Joint.GetJoint(new Vector2(JointLocs270cw[i * 2], JointLocs270cw[i * 2 + 1]) + Graphics.Position); break; default: break; } Joints[i].CanRemove = false; Joints[i].ContainingComponents.Add(this); } Joints[1].Graphics.Visible = false; Joints[1].CanBeGround = false; Joints[1].CanProvidePower = true; Joints[1].IsProvidingPower = true; Joints[1].SendingVoltage = 5; for (int i = 0; i < Joints.Length; i++) { Joints[i].Initialize(); } W = new Wire(Joints[0], Joints[1]); W.AddComponentToManager(); W.Graphics.Visible = false; W.IsRemovable = false; W.Initialize(); }
public override void InitAddChildComponents() { for (int i = 0; i < Joints.Length; i++) { switch (rotation) { case Rotation.cw0: Joints[i] = Joint.GetJoint(new Vector2(JointLocs0cw[i * 2], JointLocs0cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw90: Joints[i] = Joint.GetJoint(new Vector2(JointLocs90cw[i * 2], JointLocs90cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw180: Joints[i] = Joint.GetJoint(new Vector2(JointLocs180cw[i * 2], JointLocs180cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw270: Joints[i] = Joint.GetJoint(new Vector2(JointLocs270cw[i * 2], JointLocs270cw[i * 2 + 1]) + Graphics.Position); break; default: break; } Joints[i].Initialize(); Joints[i].CanRemove = false; Joints[i].ContainingComponents.Add(this); } W = new Wire(Joints[0], Joints[1]); W.Resistance = 250; W.Direction = Wire.WireDirection.J1ToJ2; W.AddComponentToManager(); W.Graphics.Visible = false; W.Initialize(); }
public override void InitAddChildComponents() { for (int i = 0; i < Joints.Length; i++) { switch (rotation) { case Rotation.cw0: Joints[i] = Joint.GetJoint(new Vector2(JointLocs0cw[i * 2], JointLocs0cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw90: Joints[i] = Joint.GetJoint(new Vector2(JointLocs90cw[i * 2], JointLocs90cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw180: Joints[i] = Joint.GetJoint(new Vector2(JointLocs180cw[i * 2], JointLocs180cw[i * 2 + 1]) + Graphics.Position); break; case Rotation.cw270: Joints[i] = Joint.GetJoint(new Vector2(JointLocs270cw[i * 2], JointLocs270cw[i * 2 + 1]) + Graphics.Position); break; default: break; } Joints[i].CanRemove = false; Joints[i].ContainingComponents.Add(this); } Joints[3].Graphics.Visible = false; Joints[3].CanBeGround = true; Joints[3].IsGround = true; Joints[3].CanProvidePower = false; Joints[3].IsProvidingPower = false; Joints[4].Graphics.Visible = false; Joints[4].CanProvidePower = true; Joints[4].IsProvidingPower = true; Joints[4].CanBeGround = false; Joints[4].IsGround = false; Joints[5].Graphics.Visible = false; Joints[5].CanBeGround = true; Joints[5].IsGround = true; Joints[5].CanProvidePower = false; Joints[5].IsProvidingPower = false; for (int i = 0; i < Joints.Length; i++) { Joints[i].Initialize(); } W1 = new Wire(Joints[0], Joints[3]); W1.Direction = Wire.WireDirection.J1ToJ2; W1.Resistance = 300; W1.AddComponentToManager(); W1.Graphics.Visible = false; W1.Initialize(); W2 = new Wire(Joints[1], Joints[5]); W2.Direction = Wire.WireDirection.J1ToJ2; W2.Resistance = 300; W2.AddComponentToManager(); W2.Graphics.Visible = false; W2.Initialize(); W3 = new Wire(Joints[4], Joints[2]); //W3.Direction = Wire.WireDirection.J1ToJ2; W3.Resistance = 5; W3.AddComponentToManager(); W3.Graphics.Visible = false; W3.Initialize(); }