Ejemplo n.º 1
0
 public void Update(Subject addSubject)
 {
     bool found = false;
     foreach (Subject i in subjects)
     {
         if (i.name == addSubject.name)
         {
             i.Update(addSubject);
             found = true;
             break;
         }
     }
     if (!found) subjects.Add(addSubject);
 }
Ejemplo n.º 2
0
        public void Update(Subject addSubject)
        {
            List<Joint> delJoints = new List<Joint>(joints);
            List<Marker> delMarkers = new List<Marker>(markers);

            foreach (Joint iAddJoint in addSubject.joints)
            {
                foreach (Joint iCurrentJoint in joints)
                {
                    if (iAddJoint.name == iCurrentJoint.name)
                    {
                        delJoints.Remove(iCurrentJoint); // don't delete it
                        iCurrentJoint.Update(iAddJoint);
                    }
                }
            }
            foreach (Marker iAddMarker in addSubject.markers)
            {
                foreach (Marker iCurrentMarker in markers)
                {
                    if (iAddMarker.name == iCurrentMarker.name)
                    {
                        delMarkers.Remove(iCurrentMarker); // don't delete it
                        iCurrentMarker.Update(iAddMarker);
                    }
                }
            }
            foreach (Joint j in delJoints) joints.Remove(j);
            foreach (Marker m in delMarkers) markers.Remove(m);
        }