public void AddTarget(int camid, int t) { while (mTimeDict != null && mTimeDict.ContainsKey(t)) { t++; } CamKey target = new CamKey(camid, t); Console.WriteLine("Add camkey at" + target.Camid + ' ' + target.T); if (mCamKeys == null) { mCamKeys = new List <CamKey>(); } mCamKeys.Add(target); mCamKeys.Sort((left, right) => { if (left.T < right.T) { return(-1); } else if (left.T == right.T) { return(0); } else { return(1); } }); RebuildTimeDict(); }
public void ModifyTarget(CamKey nt) { mCamKeys[mTimeDict[nt.T]] = nt; mCamKeys.Sort((left, right) => { if (left.T < right.T) { return(-1); } else if (left.T == right.T) { return(0); } else { return(1); } }); RebuildTimeDict(); }