public void DrawConstraint(cpConstraint constraint) { System.Type klass = constraint.GetType(); if (klass == typeof(cpPinJoint)) { Draw((cpPinJoint)constraint); } else if (klass == typeof(cpSlideJoint)) { Draw((cpSlideJoint)constraint); } else if (klass == typeof(cpGrooveJoint)) { Draw((cpGrooveJoint)constraint); } else if (klass == typeof(cpDampedSpring)) { Draw((cpDampedSpring)constraint); } else if (klass == typeof(cpDampedRotarySpring)) { Draw((cpDampedRotarySpring)constraint); } else if (klass == typeof(cpSimpleMotor)) { Draw((cpSimpleMotor)constraint); } }