public TrainingElement Pop() { TrainingElement first = ToDo.FirstOrDefault(te => te.TotalCount > te.TrainingStarted); if (first != null) { //first.TrainingStarted++; return(first); } return(null); }
public void Push(Troop troop, int nb = 1) { _cumulTime = null; TrainingElement first = ToDo.FirstOrDefault(te => te.Troop == troop); if (first == null) { ToDo.Add(new TrainingElement(troop, nb)); } else { first.TotalCount += nb; } }