public void AddObservation(int timestamp, string data) { var obsToCheck = new Observation(timestamp); if (this.ObservationList.ContainsKey(obsToCheck)) { this.ObservationList[obsToCheck].Data = data; } else { var obs = new Observation(timestamp, data); this.ObservationList.Add(obs, obs); } }
public Observation GetObservation(int timestamp) { var observation = new Observation(timestamp); if (this.ObservationList.ContainsKey(observation)) { observation = this.ObservationList[observation]; } else { observation = this.GetPriorObservation(timestamp); } return observation; }