2263 |
|
|
2264 |
display::Model *model_bak; |
display::Model *model_bak; |
2265 |
|
|
2266 |
|
static bool blinking(OxydStone *a) { |
2267 |
|
return (a->state==BLINKING); |
2268 |
|
} |
2269 |
static bool blinking_or_opening(OxydStone *a) { |
static bool blinking_or_opening(OxydStone *a) { |
2270 |
return (a->state==BLINKING || a->state==OPENING); |
return (a->state==BLINKING || a->state == OPENING); |
2271 |
} |
} |
2272 |
static bool not_open(OxydStone *a) { |
static bool not_open(OxydStone *a) { |
2273 |
return !(a->state==OPEN || a->state==OPENING); |
return !(a->state==OPEN || a->state==OPENING); |
2420 |
i=find_if(instances.begin(), instances.end(), blinking_or_opening); |
i=find_if(instances.begin(), instances.end(), blinking_or_opening); |
2421 |
|
|
2422 |
if (i != instances.end()) { |
if (i != instances.end()) { |
2423 |
// If colors match, open both stones. Close one of them |
// If colors match and stone (*i) is alredy blinking, open |
2424 |
// otherwise |
// both stones. Close one of them otherwise |
2425 |
if (mycolor == (*i)->int_attrib("color")) { |
if (mycolor == (*i)->int_attrib("color") && (*i)->state==BLINKING) { |
2426 |
change_state(OPEN); |
change_state(OPEN); |
2427 |
(*i)->change_state(OPEN); |
(*i)->change_state(OPEN); |
2428 |
} else { |
} else { |