public void terminoTarea(Tarea x, iRobot r) { terminadas.Add(x); for (int i = operando.Count - 1; i >= 0; i--) { for (int y = terminadas.Count - 1; y >= 0; y--) { if (operando[i].ID == r.ID) { string final = terminadas[y].termino.ToString() + " " + operando[i].ID + " Termino" + Environment.NewLine; using (StreamWriter writer = new StreamWriter(@"C:\Users\Brian\OneDrive\CETYS Drive\Programacion Objetos\20180425_Examen02_021088\Log.txt", true)) { writer.WriteLine(final); } //File.WriteAllText(@"C:\Users\Brian\OneDrive\CETYS Drive\Programacion Objetos\20180425_Examen02_021088\Log.txt", final); operando.Remove(r); esperando.Add(r); Console.WriteLine("Remove"); } } } //foreach (iRobot robot in operando) //{ // if (robot.ID == r.ID) // { // operando.Remove(r); // } //} esperando.Add(r); terminoTodo(); }
public void agregarEsclavo(iRobot r) { esperando.Add(r); }