public bool CheckConstraint(CamAttributesStruct shot1, CamAttributesStruct shot2, string constraint) { var constraintParts = constraint.Split(' '); var constraintType = constraintParts[0]; if (constraintType.Equals("=")) { var dimension = constraintParts[1]; if (dimension.Equals("scale")) { if (shot1.scale != shot2.scale) { return(false); } } if (dimension.Equals("location")) { if (shot1.targetLocation != shot2.targetLocation) { return(false); } } if (dimension.Equals("hangle")) { if (shot1.hangle != shot2.hangle) { return(false); } } } if (constraintType.Equals("not")) { var constraintName = constraintParts[1]; if (constraintName.Equals("=")) { var dimension = constraintParts[0]; if (dimension.Equals("scale")) { if (shot1.scale == shot2.scale) { return(false); } } if (dimension.Equals("hangle")) { if (shot1.hangle == shot2.hangle) { return(false); } } } } return(true); }
public bool SameScale(CamAttributesStruct other) { return(other.scale == scale); }