public void Save(ExerciseScored e) { if (!_recordBook.ContainsKey(e.ExerciseId)) { _recordBook.Add(e.ExerciseId, new History( e.Score, e.Timestamp, e.Score, e.Timestamp)); return; } var currentHistory = _recordBook[e.ExerciseId]; if (e.Score > currentHistory.Best) { _recordBook[e.ExerciseId] = new History( e.Score, e.Timestamp, e.Score, e.Timestamp); } else { _recordBook[e.ExerciseId] = new History( e.Score, e.Timestamp, currentHistory.Best, currentHistory.DateOfBest); } }
public void Save(ExerciseScored @event) { _events[@event.InstanceId].Add(@event); }
public void Save(ExerciseScored @event) { }