Beispiel #1
0
 public object Clone()
 {
     TrackObject n = new TrackObject();
     n.BestCertainityWithID = BestCertainityWithID;
     n.TrackCertainity = TrackCertainity;
     n.ObjReference = (TableObject) ObjReference.Clone();
     return n;
 }
Beispiel #2
0
        public static List<TrackObject> ConvertToTrackObjects(List<TableObject> TableObjectList)
        {
            List<TrackObject> list = new List<TrackObject>();

            //Only take objects with a defined center
            foreach (TableObject tobj in TableObjectList.Where(obj => obj.CenterDefined))
            {
                TrackObject t = new TrackObject();
                t.ObjReference = tobj;
                list.Add(t);
            }

            return list;
        }
Beispiel #3
0
        private void GuessLongTermObjects(ref List<TrackObject> ObjectList)
        {
            //Get a list of the former long term objects
            List<TableObject> OldLongTermObjects =
                _historyTrackList.GetLastFrame().ObjectList.Where(
                    obj => obj.TrackingStatus == TableObject.ETrackingStatus.LongTermTracked).ToList();

            List<TableObject> OldLongTermGuessedObjects =
                _historyTrackList.GetLastFrame().ObjectList.Where(
                    obj => obj.TrackingStatus == TableObject.ETrackingStatus.LongTermGuessed).ToList();

            //Now add them if they aren't too old
            foreach (TableObject to in OldLongTermObjects)
            {
                //Only if not in list
                if (ObjectList.Where(obj => obj.ObjReference.ObjectID == to.ObjectID).Count() == 0)
                {
                    //Check age
                    int age = _historyTrackList.GetGuessedAge(to.ObjectID);
                    if (age < SettingsManager.TrackingSet.GuessObjectMaxAge)
                    {
                        TableObject t2 = (TableObject) to.Clone();
                        TrackObject tob = new TrackObject();
                        t2.TrackingStatus = TableObject.ETrackingStatus.LongTermGuessed;
                        tob.ObjReference = t2;

                        ObjectList.Add(tob);
                    }
                }
            }

            //Do the same for the Already guessed objects
            foreach (TableObject to in OldLongTermGuessedObjects)
            {
                //Only if not in list
                if (ObjectList.Where(obj => obj.ObjReference.ObjectID == to.ObjectID).Count() == 0)
                {
                    //Check age
                    int age = _historyTrackList.GetGuessedAge(to.ObjectID);
                    if (age < SettingsManager.TrackingSet.GuessObjectMaxAge)
                    {
                        TrackObject tob = new TrackObject();
                        tob.ObjReference = to;
                        ObjectList.Add(tob);
                    }
                }
            }
        }