static void Main() { CRefri miRefri = new CRefri(50, -20); CRefriSink sink = new CRefriSink(); CTiendaSink sinkTienda = new CTiendaSink(); Random rnd = new Random(); miRefri.AgregarSink(sink); miRefri.AgregarSink(sinkTienda); while (miRefri.Kilos > 0 && sink.Paro == false) { miRefri.Trabajar(rnd.Next(1, 5)); } }
static void Main() { CRefri miRefri = new CRefri(50, 15); IEventosRefri sink = new CRefriSink(); Random rnd = new Random(); miRefri.AgregarSink(sink); while (miRefri.Kilos >= 10) { miRefri.Trabajar(rnd.Next(1, 5)); } }