private void SanitizeCurrent() { if (OnSystemNow1.Count == 0) { return; } var p = OnSystemNow1[0]; //if is being there for 10 sec we need to check if (Time.time > p.Time + 10f) { if (OnSystemNow1.Contains(p) && Family.FindPerson(p.Id) == null) { //Debug.Log("remove bz was gone OnSystemNow1:" + p.Id); OnSystemNow1.Remove(p); TransferFirstInWaitingListToOnSystemNow(); } if (WaitList.Contains(p) && Family.FindPerson(p.Id) == null) { //Debug.Log("remove bz was gone WaitList:" + p.Id); WaitList.Remove(p); } } }
private void SanitizeCurrent() { if (OnSystemNow1.Count == 0) { return; } var p = OnSystemNow1[0]; var person = Family.FindPerson(p.Id); //if is being there for 10 sec we need to check if (Time.time > p.Time + 10f) { //if the person is not RouterActive means he is not working somehow so can be removed from here if (OnSystemNow1.Contains(p) && (person == null || !person.ProfessionProp.RouterActive)) { //Debug.Log("remove from WorkQueue OnSystemNow1 Prof:" + p.Id); OnSystemNow1.Remove(p); TransferFirstInWaitingListToOnSystemNow(); } if (WaitList.Contains(p) && (person == null || !person.ProfessionProp.RouterActive)) { //Debug.Log("remove from WorkQueue WaitList Prof:" + p.Id); WaitList.Remove(p); } } }