void startGame() { foreach (LineUp2 l in spaces) { l.taken = true; l.player.GetComponent <PlayerStats2>().playing = true; } levelDifferential = findLvlDifferential(); avgPing = findPing(); DataRecorded.logPing(avgPing); DataRecorded.logLvlDif(levelDifferential); }
public void KeyWasPressed(char charPressed, long timeInTicks) { timeSinceLastAction = timeInTicks; ResetTimer(); if (keysCurrentlyHeld.ContainsKey(charPressed)) { return; } keysCurrentlyHeld.Add(charPressed, timeInTicks); if (CurrentState.Equals(SessionState.Inactive)) { CurrentState = SessionState.Active; } else { DataRecorded.Last().SecondChar = charPressed; DataRecorded.Last().CombinationID = HelperFunctions.GetCombinationId(lastKeyPress, charPressed); if (!NextKeyAlreadyPressed(DataRecorded.Last())) { DataRecorded.Last().FlightTime = TimeSpan.FromTicks(timeInTicks - KeysPressedAndReleased.Last().TimeReleasedInTicks); } DataRecorded.Last().Digraph1 = TimeSpan.FromTicks(timeInTicks - timeOfPreviousPress); DataRecorded.Last().WaitingForEvents.Remove(KeysData.WaitingForEvent.ESecondKeyPress); } KeysPressedAndReleased.Add(new KeyPressRelease(charPressed, timeInTicks)); KeysData keysData = new KeysData { FirstChar = charPressed }; DataRecorded.Add(keysData); UnprocessedData.Add(keysData); timeOfPreviousPress = timeInTicks; lastKeyPress = charPressed; }
/// <summary> /// OnThreadRecording /// </summary> private void OnThreadRecording() { while (true) { AutoResetEventDataRecorded.WaitOne(); if (CurrentRecordedHeader->dwBytesRecorded > 0) { Byte[] bytes = new Byte[CurrentRecordedHeader->dwBytesRecorded]; Marshal.Copy(CurrentRecordedHeader->lpData, bytes, 0, (int)CurrentRecordedHeader->dwBytesRecorded); DataRecorded?.Invoke(bytes); for (int i = 0; i < WaveInHeaders.Length; i++) { if ((WaveInHeaders[i]->dwFlags & Win32.WaveHdrFlags.WHDR_INQUEUE) == 0) { Win32.MMRESULT hr = Win32.waveInAddBuffer(hWaveIn, WaveInHeaders[i], sizeof(Win32.WAVEHDR)); } } } } }
public void RemoveLastDataItem() { DataRecorded.Remove(DataRecorded.Last()); }
private KeysData KeysDataWhereSecondCharIs(char secondChar) { return(DataRecorded.LastOrDefault(x => x.SecondChar == secondChar)); }
private KeysData KeysDataWhereFirstCharIs(char firstChar) { return(DataRecorded.LastOrDefault(x => x.FirstChar == firstChar)); }
void OnDestroy() { DataRecorded.logWaitTime(waitTime); }