public void UpdateGraph() { // what to do about head graph[graph.Count - 1] = currentEmotion; float subjectTime; int streamIndex = emotionStream.Count - 1; for (int i = numBars - 1; i >= 0; i--) { subjectTime = currentEmotion.time - rangeSeconds + ((float)rangeSeconds * (float)i / (float)numBars); if (subjectTime < 0) { graph[i] = Emotion.GetUndefined(subjectTime); } else { while (emotionStream[streamIndex].time > subjectTime) { streamIndex--; } graph[i] = emotionStream[streamIndex]; } } this.Redraw(); }