public void Agregar(IComparable comparable) { pila.Add(comparable); if (pila.Count == 1) { if (ordenInicio != null) { ordenInicio.Ejecutar(); } } if (ordenLlegaAlumno != null) { ordenLlegaAlumno.Ejecutar(comparable); } if (pila.Count == 40) { if (ordenAulaLlena != null) { ordenAulaLlena.Ejecutar(); } } }
public void Agregar(IComparable comparable) { if (!Pertenece(comparable)) { conjunto.Add(comparable); } if (conjunto.Count == 1) { if (ordenInicio != null) { ordenInicio.Ejecutar(); } } if (ordenLlegaAlumno != null) { ordenLlegaAlumno.Ejecutar((IAlumno)comparable); } if (conjunto.Count == 40) { if (ordenAulaLlena != null) { ordenAulaLlena.Ejecutar(); } } }