public bool fullRelease(inputObj iObj) { if (inputGroup.Count == 0 && inputGroupOld.Count == 0) { return(true); } foreach (inputObj ip in inputGroup) { if (ip.joy == iObj.joy && ip.inputMarker.CompareTo(iObj.inputMarker) == 0) { return(false); } } foreach (inputObj ip in inputGroupOld) { if (ip.joy == iObj.joy && ip.inputMarker.CompareTo(iObj.inputMarker) == 0) { return(false); } } return(true); }
public double activeAtAll(inputObj iObj) { bool positive = false; if (iObj.value > 0) { positive = true; } foreach (inputObj ip in inputGroup) { if (ip.joy == iObj.joy && ip.inputMarker.CompareTo(iObj.inputMarker) == 0) { if (iObj.inputMarker.CompareTo("pov") == 0) { if (ip.value == iObj.value) { return(1); } } else if (ip.value >= iObj.value && positive) { return(ip.value); } else if (ip.value <= iObj.value && !positive) { return(ip.value); } return(0); } } return(0); }
public bool checkIfNowReleased(inputObj iObj) { bool currentState = false, oldState = false; foreach (inputObj ip in inputGroup) { if (ip.joy == iObj.joy && ip.inputMarker.CompareTo(iObj.inputMarker) == 0) { currentState = true; } } foreach (inputObj ip in inputGroupOld) { if (ip.joy == iObj.joy && ip.inputMarker.CompareTo(iObj.inputMarker) == 0) { oldState = true; } } if (!currentState && oldState) { return(true); } return(false); }
public bool checkIfFirstPress(inputObj iObj) { bool positive = false; if (iObj.value > 0) { positive = true; } bool currentState = false, oldState = false; foreach (inputObj ip in inputGroup) { if (ip.joy == iObj.joy && ip.inputMarker.CompareTo(iObj.inputMarker) == 0) { if (ip.value >= iObj.value && positive) { currentState = true; } else if (ip.value <= iObj.value && !positive) { currentState = true; } } } foreach (inputObj ip in inputGroupOld) { if (ip.joy == iObj.joy && ip.inputMarker.CompareTo(iObj.inputMarker) == 0) { oldState = true; } } if (currentState && !oldState) { return(true); } return(false); }