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); } } }
/// <summary> /// Called when DoneReRoute() is called /// </summary> private void TransferFirstInWaitingListToOnSystemNow() { if (WaitList.Count == 0) { return; } var t = WaitList[0]; WaitList.RemoveAt(0); OnSystemNow1.Add(t); }
/// <summary> /// Called when DoneReRoute() is called /// </summary> private void TransferFirstInWaitingListToOnSystemNow() { if (WaitList.Count == 0) { return; } var t = WaitList[0]; WaitList.RemoveAt(0); OnSystemNow1.Add(t); //Debug.Log("transfer to System:"+t.Id); }
/// <summary> /// To bne call when person dies /// </summary> /// <param name="id"></param> public void RemoveMeFromSystem(string id) { var wIndex = WaitList.FindIndex(a => a.Id == id); if (wIndex > -1) { WaitList.RemoveAt(wIndex); } var sIndex = OnSystemNow1.FindIndex(a => a.Id == id); if (sIndex > -1) { OnSystemNow1.RemoveAt(sIndex); } }
/// <summary> /// To bne call when person dies /// </summary> /// <param name="id"></param> public void RemoveMeFromSystem(string id) { var wIndex = WaitList.FindIndex(a => a.Id == id); if (wIndex > -1) { //Debug.Log("remove from waitL:"+id); WaitList.RemoveAt(wIndex); } var sIndex = OnSystemNow1.FindIndex(a => a.Id == id); if (sIndex > -1) { //Debug.Log("remove from systemNow:" + id); OnSystemNow1.RemoveAt(sIndex); } }