void Union::simulate()
{
+ RGB c_in1, c_in2;
+ unsigned r,g,b;
+
if (!updated) {
return;
}
+ std::list<IConector *>::iterator i = in_list.begin();
+ if (i != in_list.end()) {
+ PlantItem *o = (PlantItem *)(*i);
+ c_in1 = o->get_color();
+ i++;
+ o = (PlantItem *)(*i);
+ c_in2 = o->get_color();
+ }
+ r = ((c_in1.r()+c_in2.r())/2)%256;
+ g = ((c_in1.g()+c_in2.g())/2)%256;
+ b = ((c_in1.b()+c_in2.b())/2)%256;
+ set_color(RGB(r,g,b));
std::cout << name << "::Flujo actual = " << actual_flow << std::endl;
updated = false;
in_on_zero = 0;