public float GetMapLineOpacity(Properties.IMagnetic c = null) { if (c == null) { return((float)(MaxVoltage / Joints[0].SendingVoltage)); } else { return((float)(MaxVoltage / (c as Properties.IMagnetic).GetFieldForce(Graphics.Center.X, Graphics.Center.Y).Length())); } }
public float GetMapLineOpacity(Properties.IMagnetic c = null) { if (c == null) { return(W.IsConnected ? 1f : 0f); } else { return((c as Properties.IMagnetic).GetFieldForce(Graphics.Center.X, Graphics.Center.Y).Length() > (Logics as Logics.ReedSwitchLogics).RequiredField ? 1f : 0f); } }
/// <summary> /// Returns max magnetic field at a specific point /// </summary> /// <param name="x"></param> /// <param name="y"></param> /// <param name="blacklist">Component to ignore</param> /// <returns></returns> public static Vector2 GetMagneticField(float x, float y, Properties.IMagnetic blacklist) { Vector2 d = new Vector2(); for (int i = 0; i < MagnetComponents.Count; i++) { if (MagnetComponents[i] != blacklist) { d += MagnetComponents[i].GetFieldForce(x, y); } } return(d); }