예제 #1
0
파일: Pnj.cpp 프로젝트: eduardok/ZeldaROTH
void Pnj::moveY(int i) {
    if (gpJeu->isLink(x + gpZoneBase->getZone()->x, y + gpZoneBase->getZone()->y + i, 
        gpZoneBase->getZone()->w, gpZoneBase->getZone()->h)) return;
    if (gpJeu->isEnnemi(x + gpZoneBase->getZone()->x, y + gpZoneBase->getZone()->y + i, 
        gpZoneBase->getZone()->w, gpZoneBase->getZone()->h)) return;
    if (gpJeu->isPnj(x + gpZoneBase->getZone()->x, y + gpZoneBase->getZone()->y + i, 
        gpZoneBase->getZone()->w, gpZoneBase->getZone()->h, getListId())) return;
    if (!gpJeu->isNotFull(x + gpZoneBase->getZone()->x, y + gpZoneBase->getZone()->y + i, 
        gpZoneBase->getZone()->w, gpZoneBase->getZone()->h, 0, 0, 0)) return;
    y+=i;
}
예제 #2
0
bool StatsStreamList::update() {

    time_t now;
    time (&now);

    int diff = difftime (now,this->timeStamp);

    if (diff > 10)
    {
        this->calculateRate(diff);
        cout << "list_id " << getListId() << " rate= "<< actualRate << endl;
        this->updateTimeStamp();
    }

}