Пример #1
0
void cxTimeLine::OnStep(cxFloat dt)
{
    cxFloat elapsed = Elapsed();
    for(cxInt i = idx;i<Length();i++){
        if(elapsed < times.at(i)){
            break;
        }
        if(prev == i){
            continue;
        }
        idx = i;
        prev = i;
        OnTime(At(idx));
    }
    cxAction::OnStep(dt);
}
Пример #2
0
void Interface::Step() {
    if (OnTime() == false) {
        return;
    }

    Update();

    switch (direction_) {
     case 'T':
        // Send (T)o
        Send();
        break;
     case 'F':
        // Receive (F)rom
        Receive();
        break;
     default:
        // Undefined direction.
        break;
    }
}