Пример #1
0
bool zoneManager::getOffTrig(ofPtr<zone> z) {

    if(!z->getIsFired())return false;

    zoneRule on_zr = z->getOnRule();
    zoneRule off_zr = z->getOffRule();

    if(!on_zr.isEnabled) {
        return true;
    } else if(!off_zr.isEnabled) {
        return !getIsRuleMet(z,on_zr);// will fire when on rule is no longer met
    } else {
        return getIsRuleMet(z, off_zr); // off overrides on
    }

}
Пример #2
0
bool zoneManager::getOnTrig(ofPtr<zone> z) {

    if(z->getIsFired())return false; //this could be variable

    zoneRule on_zr = z->getOnRule();
    zoneRule off_zr = z->getOffRule();

    if(!on_zr.isEnabled) {
        return true;
    } else if(!off_zr.isEnabled) {
        return getIsRuleMet(z,on_zr);
    } else {
        return getIsRuleMet(z, off_zr)? false : getIsRuleMet(z,on_zr); //off overrides on
    }

}