TEST(ServiceChargeTransactionTest, PayrollTest) { int empid = 7; AddHourlyEmployee ahe(empid, "Test7", "Home7", 50.00); ahe.Execute(); Employee *e = ((DatabaseProxy *)getInstance())->GetEmployee(empid); EXPECT_TRUE(e != 0); Affiliation * af(new UnionAffiliation()); e->SetAffilication(af); int memberId = 86; ((DatabaseProxy *)getInstance())->AddUnionMember(memberId, e); Date date(2005, 8, 8); ServiceChargeTransaction sct(memberId, date, 12.95); sct.Execute(); e = ((DatabaseProxy *)getInstance())->GetEmployee(empid); UnionAffiliation* uf = dynamic_cast<UnionAffiliation*>(e->GetAffilication()); EXPECT_TRUE(uf != 0); ServiceCharge sc = uf->GetServiceCharge(date); EXPECT_TRUE(sc.GetAmount() == 12.95); }
void Foam::myHeatFluxFvPatchVectorField::updateCoeffs() { if (this->updated()) { return; } // VARIABLEN/FELDER scalarField sn(patch().size()), st(patch().size()), sct(patch().size()), gt(patch().size()); vectorField t(patch().size()), n(patch().size()); vectorField& s = *this; // Berechnung von Richtungen n = this->patch().nf(); // for(int i=0; i<g0.size(); i++){ // if(mag(g0[i]) == 0) // t[i] = vector(0,0,0); // else // t[i] = g0[i]/mag(g0[i]); // } for(int i=0; i<n.size(); i++){ const vector vec = n[i]; t[i] = vector(vec.y(),-vec.x(),0); } // Betrag in normalen Richtung n const volScalarField& internalTheta = db().lookupObject<volScalarField>("Theta"); const label patchID = patch().boundaryMesh().findPatchID(patch().name()); scalarField boundaryTheta = internalTheta.boundaryField()[patchID]; boundaryTheta = OFinterpolate(patch(), db(), boundaryTheta); sn = alpha * (boundaryTheta - Theta_wall); // Betrag in tangentiale Richtung t (Approximation durch einseitige FD) vector e1(1,0,0); vector e2(0,1,0); vector e3(0,0,1); vectorField sc = this->patchInternalField(); scalarField d = 1.0/this->patch().deltaCoeffs(); gt = ( (g0 ^ n) & e3 ); sct = ( (sc ^ n) & e3 ); st = ( sct - d*gt ) / ( 1 + d*gamma ); // gesamter Wärmestrom s s = sn*n + st*t; fixedValueFvPatchVectorField::updateCoeffs(); }
void Foam::myHeatFluxFvPatchVectorField::updateCoeffs() { if (this->updated()) { return; } // VARIABLEN/FELDER scalarField sn(patch().size()), st(patch().size()), sct(patch().size()), gt(patch().size()); vectorField t(patch().size()), n(patch().size()); vectorField& s = *this; // Berechnung von Richtungen n = this->patch().nf(); t = g0/mag(g0); // Betrag in normalen Richtung n fvPatchField<scalar> boundaryTheta = interpolateBoundaryTheta(); sn = alpha * (boundaryTheta - Theta_wall); // Betrag in tangentiale Richtung t (Approximation durch einseitige FD) vector e1(1,0,0); vector e2(0,1,0); vector e3(0,0,1); vectorField sc = this->patchInternalField(); scalarField d = 1.0/this->patch().deltaCoeffs(); gt = ( (g0 ^ n) & e2 ); sct = ( (sc ^ n) & e2 ); st = ( sct - d*gt ) / ( 1 + d*gamma ); // gesamter Wärmestrom s s = sn*n + st*t; fixedValueFvPatchVectorField::updateCoeffs(); }
static void _thread_stub2( void *arg ) { boost::shared_ptr<SocketClientThread> sct( static_cast<SocketClientThread*>( arg ) ); sct->run(); }
void LVL_Npc::update(float tickTime) { float accelCof=tickTime/1000.0f; if(killed) return; if(wasDeactivated) return; _onGround = !collided_bottom.isEmpty(); if(isGenerator) { updateCollisions(); activationTimeout-=tickTime; updateGenerator(tickTime); return; } event_queue.processEvents(tickTime); if(warpSpawing) { setSpeed(0.0, 0.0); return; } PGE_Phys_Object::update(tickTime); if(deActivatable) activationTimeout-=tickTime; animator.manualTick(tickTime); if(motionSpeed!=0) { if(!collided_left.isEmpty()) setDirection(1); else if(!collided_right.isEmpty()) setDirection(-1); else if(setup->turn_on_cliff_detect && cliffDetected) { setDirection(_direction*-1); cliffDetected=false; } setSpeedX((motionSpeed*accelCof)*_direction); } if(not_movable()) { detector_player_pos.processDetector(); if(detector_player_pos.directedTo()!=0) setDirection(detector_player_pos.directedTo()); } LVL_Section *section=sct(); PGE_RectF sBox = section->sectionRect(); if(section->isWarp()) { if(posX()<sBox.left()-_width-1 ) setPosX(sBox.right()-1); else if(posX()>sBox.right() + 1 ) setPosX(sBox.left()-_width+1); } for(int i=0; i<detectors.size(); i++) detectors[i]->processDetector(); try { lua_onLoop(tickTime); } catch (luabind::error& e) { LvlSceneP::s->getLuaEngine()->postLateShutdownError(e); } }
/* PROGRAM: keyConvertIxToCx - converts keystr: old ix format to new cx format * * This function overwrites only the following members of the dsmKey_t * structure, and leaves all the other members alone: * * keystr * * keyLen * * unknown_comp * * New Format: * 1st byte - total length of key and info. * 2nd byte - size of the key (ks) * 3rd byte - size of the info (is) * followed by the key, followed by the info. * * The new cx format uses some special characters. * The special characters are as follows: * * x'00' - component separator, will sort lower that any value. * x'01' - low escape character. * x'ff' - High escape character. * * When a special character is found in a regular component of a key, * it will be replaced with an escape sequence that will preserve the * collating sequence, as follows: * * x'00' - will be replaced with escape sequence x'01fe' * x'01' - will be replaced with escape sequence x'01ff' * x'ff' - will be replaced with escape sequence x'ff01' * * Additional escape sequences are: * * x'0101' LOW-RANGE value, it will sort higher than component separator * but lower than any other value except. * NOTICE: a LOWRANGE in the old index, if not in the * 1st component will cause the following conversion: * the last byte of the previous component will be * decremented by 1, and a HIGHRANGE value will be * concatennated to it. * x'01f0' NULL component like "" char value, it will sort higher than * component separator and higher than LOW-RANGE, but * less than any other value. * x'01fb' LOW-UNKNOWN value, it will sort higher than component separator * but lower than any other value. * x'fffc' HIGH-UNKNOWN value, it will sort higher than component separator * and higher than any other value except HIGH-RANGE. * x'ffff' HIGH-RANGE value, it will sort higher than component separator * but higher than any other value. * * RETURNS: DSM_S_SUCCESS * KEY_BUFFER_TOO_SMALL * KEY_ILLEGAL (-0xfa) if an illegal component was found. */ keyStatus_t keyConvertIxToCx( dsmKey_t *pdsmKey, /* OUT storamge manager key structure */ dsmIndex_t indexNumber, /* IN object-number of index*/ dsmBoolean_t ksubstr _UNUSED_, /* IN substring ok bit */ dsmBoolean_t wordIndex, /* IN is this for a word index (i.e. * keyString is list of words) */ TEXT keyString[], /* IN keyString in IX format */ LONG bufferSize) /* IN max possible length for keystr */ { LONG availableBuffer = 0x0fff; /* for check before adding more * bytes to keystr */ TEXT *pce; /* points to the end of a source component */ TEXT *pend; /* points to the end of the source key */ TEXT *pfrom; /* points to the source key */ TEXT *pto; /* points to the target key */ TEXT unknown = 0; TEXT *p_start_to; TEXT *pWordStart = 0; pdsmKey->unknown_comp = 0; pto = pdsmKey->keystr; if ( bufferSize != KEY_NO_LENGTH_CHECK ) availableBuffer = bufferSize - keyString[0]; /******* this proc is used for small keys only in MySQL****/ if ( wordIndex ) { /* word-index */ /*#ifdef LARGE_INDEX_ENTRIES_DISABLED */ pfrom = keyString + 1; pend = pfrom + *pfrom + 1; /* word list len does not include trailing * length byte. */ /*#else */ /*** ????????????????????????????***/ /*#endif LARGE_INDEX_ENTRIES_DISABLED */ } /* word-index */ else { /* !word-index */ pfrom = keyString; /*#ifdef LARGE_INDEX_ENTRIES_DISABLED */ /* KEY_LENGTH_CHECK(6,availableBuffer,bufferSize); */ /* pto += 3; skip the 1st byte which is used for the total size */ /* skip the 2nd byte which is used for the key size */ /* skip the 3nd byte which is used for the info size */ /*#else */ KEY_LENGTH_CHECK(FULLKEYHDRSZ+4,availableBuffer,bufferSize); pto += FULLKEYHDRSZ; /* skip header with all the sizes */ /*#endif LARGE_INDEX_ENTRIES_DISABLED */ *pto++ = 0; /* mark the new format & define the type of the index = 0 */ *pto++ = 0; /* mark the new format */ sct(pto, indexNumber); /* index number */ pto += 2; /*#ifdef LARGE_INDEX_ENTRIES_DISABLED */ pend = pfrom + *pfrom - 1; /* the key lng byte at the end */ } /* !word-index */ pfrom++; /* to 1st component */ /*#else */ /* ?????? */ /*#endif LARGE_INDEX_ENTRIES_DISABLED */ if (pfrom == pend) /* the key is empty, used for default key */ { KEY_LENGTH_CHECK(2,availableBuffer,bufferSize); *pto++ = LOWESCAPE; *pto++ = NULLCOMPONENT; *pto++ = 0; goto done; } p_start_to = pto; /* start of new key */ do { /* while (pfrom != pend); / * scan the key components and convert */ if ( wordIndex ) { /* word-index */ /* For each word in the ditem we create a whole key string. */ pWordStart = pto; /*#ifdef LARGE_INDEX_ENTRIES_DISABLED */ KEY_LENGTH_CHECK(6,availableBuffer,bufferSize); pto +=3; /* skip the 1st byte which is used for the total size */ /* skip the 2nd byte which is used for the key size */ /* skip the 2nd byte which is used for the info size */ /*#else */ /* KEY_LENGTH_CHECK(FULLKEYHDRSZ+4,availableBuffer,bufferSize); */ /* pto += FULLKEYHDRSZ; skip header with all the sizes */ /*#endif LARGE_INDEX_ENTRIES_DISABLED */ *pto++ =0; /* mark new format & define the type of the index = 0 */ *pto++ =0; /* mark the new format */ sct(pto, indexNumber); /* index number */ pto += 2; } /* word-index */ /* scan all the key components and convert */ if (*pfrom <= LKYFLAG) /* it is an ordinary component */ { if (*pfrom == 0) /* a null component */ { KEY_LENGTH_CHECK(1,availableBuffer,bufferSize); *pto++ = LOWESCAPE; *pto++ = NULLCOMPONENT; pfrom++; } else for (pce = pfrom + *pfrom, pfrom++; pfrom <= pce; pfrom++, pto++) { /* NOTE: the following checks whether ch equals 0xff, 0 or 1 */ /* It relies on overflow to change the range to 0, 1, 2 so */ /* that it can be done in one if statement. This is rather */ /* dirty, but since the key conversion is called frequently, */ /* it seems to be worth it */ if ((TEXT)(*pfrom + 1) > (TEXT)2) { *pto = *pfrom; } else if (*pfrom < (TEXT)2) { KEY_LENGTH_CHECK(1,availableBuffer,bufferSize); *pto++ = LOWESCAPE; *pto = REPLACEZERO + *pfrom; /* REPLACEZERO or REPLACEONE */ } else /* *pfrom must be 0xff */ { KEY_LENGTH_CHECK(1,availableBuffer,bufferSize); *pto++ = HIGHESCAPE; *pto = REPLACEFF; } } /* for each byte in the string */ } /* it is an ordinary component */ else /* it is a special flag */ { switch (*pfrom) { case LOWRANGE: if (pto != p_start_to) /* not 1'st component */ pto--; break; case HIGHRANGE: KEY_LENGTH_CHECK(1,availableBuffer,bufferSize); *pto++ = HIGHESCAPE; *pto++ = HIGHRANGE; break; case HIGHMISSING: KEY_LENGTH_CHECK(1,availableBuffer,bufferSize); *pto++ = HIGHESCAPE; *pto++ = HIGHMISSING; unknown=1; break; case LOWMISSING: KEY_LENGTH_CHECK(1,availableBuffer,bufferSize); *pto++ = LOWESCAPE; *pto++ = LOWMISSING; unknown=1; break; case KEY_ILLEGAL: return KEY_ILLEGAL; /* illegal key */ default: return KEY_ILLEGAL; /* illegal key */ } pfrom++; } /* it is a special flag */ /* end of component */ *pto++ = COMPSEPAR; /* null separator */ if ( wordIndex ) { /* Add in the length for a word list key */ /*#ifdef LARGE_INDEX_ENTRIES_DISABLED */ *pWordStart = pto - pWordStart - 3; *(pWordStart + 1) = pto - pWordStart - 3; /*#else */ /* sct(pWordStart + TS_OFFSET, pto - pWordStart - FULLKEYHDRSZ); */ /* sct(pWordStart + KS_OFFSET, pto - pWordStart - FULLKEYHDRSZ); */ /*#endif LARGE_INDEX_ENTRIES_DISABLED */ } } while (pfrom != pend); /* scan the key components and convert */ done: /*#ifdef LARGE_INDEX_ENTRIES_DISABLED */ /* pdsmKey->keyLen = pto - pdsmKey->keystr - 3; */ /* if ( !wordIndex ) */ /* { */ /* pdsmKey->keystr[0] = (TEXT)pdsmKey->keyLen; */ /* pdsmKey->keystr[1] = (TEXT)pdsmKey->keyLen; */ /*} */ /*#else */ pdsmKey->keyLen = pto - pdsmKey->keystr - FULLKEYHDRSZ; if ( !wordIndex ) { sct(&pdsmKey->keystr[TS_OFFSET], pdsmKey->keyLen); sct(&pdsmKey->keystr[KS_OFFSET], pdsmKey->keyLen); } /*#endif LARGE_INDEX_ENTRIES_DISABLED */ if (unknown) pdsmKey->unknown_comp = 1; else pdsmKey->unknown_comp = 0; return KEY_SUCCESS; } /* end keyConvertIxToCx */
void sclass::csave() { save(sct()); }
void LVL_Player::update(float ticks) { if(isLocked) return; if(!_isInited) return; if(!camera) return; LVL_Section* section = sct(); if(!section) return; event_queue.processEvents(ticks); if((isWarping) || (!isAlive)) { animator.tickAnimation(ticks); updateCamera(); return; } _onGround = !foot_contacts_map.isEmpty(); on_slippery_surface = !foot_sl_contacts_map.isEmpty(); bool climbableUp = !climbable_map.isEmpty(); bool climbableDown= climbableUp && !_onGround; climbing = (climbableUp && climbing && !_onGround && (posRect.center().y()>=(climbableHeight-physics_cur.velocity_climb_y_up)) ); if(_onGround) { phys_setup.decelerate_x = (fabs(speedX())<=physics_cur.MaxSpeed_walk)? (on_slippery_surface?physics_cur.decelerate_stop/physics_cur.slippery_c : physics_cur.decelerate_stop): (on_slippery_surface?physics_cur.decelerate_run/physics_cur.slippery_c : physics_cur.decelerate_run); if(physics_cur.strict_max_speed_on_ground) { if((speedX()>0)&&(speedX()>phys_setup.max_vel_x)) setSpeedX(phys_setup.max_vel_x); else if((speedX()<0)&&(speedX()<phys_setup.min_vel_x)) setSpeedX(phys_setup.min_vel_x); } } else phys_setup.decelerate_x = physics_cur.decelerate_air; if(doKill) { doKill=false; isAlive = false; setPaused(true); LvlSceneP::s->checkPlayers(); return; } if(climbing) { PGE_Phys_Object* climbableItem = static_cast<PGE_Phys_Object*>((void*)(intptr_t)climbable_map[climbable_map.keys().first()]); if(climbableItem) { _velocityX_add=climbableItem->speedX(); _velocityY_add=climbableItem->speedY(); } else { _velocityX_add=0.0f; _velocityY_add=0.0f; } if(gscale_Backup != 1) { setGravityScale(0); gscale_Backup = 1; } } else { if(gscale_Backup != 0.f) { setGravityScale(physics_cur.gravity_scale); gscale_Backup = 0.f; } } if(climbing) { setSpeed(0,0); } if(environments_map.isEmpty()) { if(last_environment!=section->getPhysicalEnvironment() ) { environment = section->getPhysicalEnvironment(); } } else { int newEnv = section->getPhysicalEnvironment(); foreach(int x, environments_map) { newEnv = x; } if(last_environment != newEnv) { qDebug()<<"Enter to environment" << newEnv; environment = newEnv; } } refreshEnvironmentState(); if(_onGround) { if(!floating_isworks) { floating_timer=floating_maxtime; } } //Running key if(keys.run) { if(!_isRunning) { phys_setup.max_vel_x = physics_cur.MaxSpeed_run; phys_setup.min_vel_x = -physics_cur.MaxSpeed_run; _isRunning=true; } } else { if(_isRunning) { phys_setup.max_vel_x = physics_cur.MaxSpeed_walk; phys_setup.min_vel_x = -physics_cur.MaxSpeed_walk; _isRunning=false; } } if((physics_cur.ground_c_max!=1.0f)) { phys_setup.max_vel_x = fabs(_isRunning ? physics_cur.MaxSpeed_run : physics_cur.MaxSpeed_walk) *(_onGround?physics_cur.ground_c_max:1.0f); phys_setup.min_vel_x = -fabs(_isRunning ? physics_cur.MaxSpeed_run : physics_cur.MaxSpeed_walk) *(_onGround?physics_cur.ground_c_max:1.0f); } if(keys.alt_run) { if(attack_enabled && !attack_pressed && !climbing) { attack_pressed=true; if(keys.up) attack(Attack_Up); else if(keys.down) attack(Attack_Down); else { attack(Attack_Forward); PGE_Audio::playSoundByRole(obj_sound_role::PlayerTail); animator.playOnce(MatrixAnimator::RacoonTail, _direction, 75, true, true, 1); } } } else { if(attack_pressed) attack_pressed=false; } //if if(!keys.up && !keys.down && !keys.left && !keys.right) { if(wasEntered) { wasEntered = false; wasEnteredTimeout=0; } } //Reset state if(wasEntered) { wasEnteredTimeout-=ticks; if(wasEnteredTimeout<0) { wasEnteredTimeout=0; wasEntered=false; } } if(keys.up) { if(climbableUp&&(jumpTime<=0)) { setDuck(false); climbing=true; floating_isworks=false;//!< Reset floating on climbing start } if(climbing) { if(posRect.center().y() >= climbableHeight) setSpeedY(-physics_cur.velocity_climb_y_up); } } if(keys.down) { if( climbableDown && (jumpTime<=0) ) { setDuck(false); climbing=true; floating_isworks=false;//!< Reset floating on climbing start } else { if((duck_allow & !ducking)&&( (animator.curAnimation()!=MatrixAnimator::RacoonTail) ) ) { setDuck(true); } } if(climbing) { setSpeedY(physics_cur.velocity_climb_y_down); } } else { if(ducking) setDuck(false); } if( (!keys.left) || (!keys.right) ) { bool turning=(((speedX()>0)&&(_direction<0))||((speedX()<0)&&(_direction>0))); float force = turning? physics_cur.decelerate_turn : (fabs(speedX())>physics_cur.MaxSpeed_walk)?physics_cur.run_force : physics_cur.walk_force; if(on_slippery_surface) force=force/physics_cur.slippery_c; else if((_onGround)&&(physics_cur.ground_c!=1.0f)) force=force*physics_cur.ground_c; if(keys.left) _direction=-1; if(keys.right) _direction=1; if(!ducking || !_onGround) { //If left key is pressed if(keys.right && collided_right.isEmpty()) { if(climbing) setSpeedX(physics_cur.velocity_climb_x); else applyAccel(force, 0); } //If right key is pressed if(keys.left && collided_left.isEmpty()) { if(climbing) setSpeedX(-physics_cur.velocity_climb_x); else applyAccel(-force, 0); } } } if( keys.alt_jump ) { //Temporary it is ability to fly up! if(!bumpDown && !bumpUp) { setSpeedY(-physics_cur.velocity_jump); } } if( keys.jump ) { if(!JumpPressed) { if(environment!=LVL_PhysEnv::Env_Water) { if(climbing || _onGround || (environment==LVL_PhysEnv::Env_Quicksand)) PGE_Audio::playSoundByRole(obj_sound_role::PlayerJump); } else PGE_Audio::playSoundByRole(obj_sound_role::PlayerWaterSwim); } if((environment==LVL_PhysEnv::Env_Water)||(environment==LVL_PhysEnv::Env_Quicksand)) { if(!JumpPressed) { if(environment==LVL_PhysEnv::Env_Water) { if(!ducking) animator.playOnce(MatrixAnimator::SwimUp, _direction, 75); } else if(environment==LVL_PhysEnv::Env_Quicksand) { if(!ducking) animator.playOnce(MatrixAnimator::JumpFloat, _direction, 64); } JumpPressed=true; jumpTime = physics_cur.jump_time; jumpVelocity=physics_cur.velocity_jump; floating_timer = floating_maxtime; setSpeedY(speedY()-jumpVelocity); } } else if(!JumpPressed) { JumpPressed=true; if(_onGround || climbing) { climbing=false; jumpTime=physics_cur.jump_time; jumpVelocity=physics_cur.velocity_jump; floating_timer = floating_maxtime; setSpeedY(-jumpVelocity-fabs(speedX()/physics_cur.velocity_jump_c)); } else if((floating_allow)&&(floating_timer>0)) { floating_isworks=true; //if true - do floating with sin, if false - do with cos. floating_start_type=(speedY()<0); setSpeedY(0); setGravityScale(0); } } else { if(jumpTime>0) { jumpTime -= ticks; setSpeedY(-jumpVelocity-fabs(speedX()/physics_cur.velocity_jump_c)); } if(floating_isworks) { floating_timer -= ticks; if(floating_start_type) setSpeedY( state_cur.floating_amplitude*(-cos(floating_timer/80.0)) ); else setSpeedY( state_cur.floating_amplitude*(cos(floating_timer/80.0)) ); if(floating_timer<=0) { floating_timer=0; floating_isworks=false; setGravityScale(climbing?0:physics_cur.gravity_scale); } } } } else { jumpTime=0; if(JumpPressed) { JumpPressed=false; if(floating_allow) { if(floating_isworks) { floating_timer=0; floating_isworks=false; setGravityScale(climbing?0:physics_cur.gravity_scale); } } } } refreshAnimation(); animator.tickAnimation(ticks); PGE_RectF sBox = section->sectionLimitBox(); //Return player to start position on fall down if( posY() > sBox.bottom()+_height ) { kill(DEAD_fall); } if(bumpDown) { bumpDown=false; jumpTime=0; setSpeedY(bumpVelocity); } else if(bumpUp) { bumpUp=false; if(keys.jump) { jumpTime=bumpJumpTime; jumpVelocity=bumpJumpVelocity; } setSpeedY( (keys.jump ? (-fabs(bumpJumpVelocity)-fabs(speedX()/physics_cur.velocity_jump_c)): -fabs(bumpJumpVelocity)) ); } //Connection of section opposite sides if(isExiting) // Allow walk offscreen if exiting { if((posX() < sBox.left()-_width-1 )||(posX() > sBox.right() + 1 )) { setGravityScale(0.0);//Prevent falling [we anyway exited from this level, isn't it?] setSpeedY(0.0); } if(keys.left||keys.right) { if((environment==LVL_PhysEnv::Env_Water)||(environment==LVL_PhysEnv::Env_Quicksand)) { keys.run=true; if(_exiting_swimTimer<0 && !keys.jump) keys.jump=true; else if(_exiting_swimTimer<0 && keys.jump) { keys.jump=false; _exiting_swimTimer=(environment==LVL_PhysEnv::Env_Quicksand)? 1 : 500; } _exiting_swimTimer-= ticks; } else keys.run=false; } } else if(section->isWarp()) { if(posX() < sBox.left()-_width-1 ) setPosX( sBox.right()+1 ); else if(posX() > sBox.right() + 1 ) setPosX( sBox.left()-_width-1 ); } else { if(section->ExitOffscreen()) { if(section->RightOnly()) { if( posX() < sBox.left()) { setPosX( sBox.left() ); setSpeedX(0.0); } } if((posX() < sBox.left()-_width-1 ) || (posX() > sBox.right() + 1 )) { setLocked(true); _no_render=true; LvlSceneP::s->setExiting(1000, LvlExit::EXIT_OffScreen); return; } } else { //Prevent moving of player away from screen if( posX() < sBox.left()) { setPosX(sBox.left()); setSpeedX(0.0); } else if( posX()+_width > sBox.right()) { setPosX(sBox.right()-_width); setSpeedX(0.0); } } } if(_stucked) { posRect.setX(posRect.x()-_direction*2); applyAccel(0, 0); } processWarpChecking(); if(_doSafeSwitchCharacter) setCharacter(characterID, stateID); try { lua_onLoop(); } catch (luabind::error& e) { LvlSceneP::s->getLuaEngine()->postLateShutdownError(e); } updateCamera(); }
void KatePluginSymbolViewerView::parseXsltSymbols(void) { if (!win->activeView()) return; popup->changeItem( popup->idAt(2),i18n("Show Params")); popup->changeItem( popup->idAt(3),i18n("Show Variables")); popup->changeItem( popup->idAt(4),i18n("Show Templates")); QString cl; // Current Line QString stripped; char comment = 0; char templ = 0; int i; QPixmap cls( ( const char** ) class_xpm ); QPixmap sct( ( const char** ) struct_xpm ); QPixmap mcr( ( const char** ) macro_xpm ); QPixmap cls_int( ( const char** ) class_int_xpm ); QTreeWidgetItem *node = NULL; QTreeWidgetItem *mcrNode = NULL, *sctNode = NULL, *clsNode = NULL; QTreeWidgetItem *lastMcrNode = NULL, *lastSctNode = NULL, *lastClsNode = NULL; KTextEditor::Document *kv = win->activeView()->document(); //kdDebug(13000)<<"Lines counted :"<<kv->numLines()<<endl; if(treeMode) { mcrNode = new QTreeWidgetItem(symbols, QStringList( i18n("Params") ) ); sctNode = new QTreeWidgetItem(symbols, QStringList( i18n("Variables") ) ); clsNode = new QTreeWidgetItem(symbols, QStringList( i18n("Templates") ) ); mcrNode->setIcon(0, QIcon(mcr)); sctNode->setIcon(0, QIcon(sct)); clsNode->setIcon(0, QIcon(cls)); if (expanded_on) { symbols->expandItem(mcrNode); symbols->expandItem(sctNode); symbols->expandItem(clsNode); } lastMcrNode = mcrNode; lastSctNode = sctNode; lastClsNode = clsNode; symbols->setRootIsDecorated(1); } else { symbols->setRootIsDecorated(0); } for (i=0; i<kv->lines(); i++) { cl = kv->line(i); cl = cl.trimmed(); if(cl.indexOf(QRegExp("<!--")) >= 0) { comment = 1; } if(cl.indexOf(QRegExp("-->")) >= 0) { comment = 0; continue; } if(cl.indexOf(QRegExp("^</xsl:template>")) >= 0) { templ = 0; continue; } if (comment==1) { continue; } if (templ==1) { continue; } if(cl.indexOf(QRegExp("^<xsl:param ")) == 0 && macro_on) { QString stripped = cl.remove(QRegExp("^<xsl:param +name=\"")); stripped = stripped.remove(QRegExp("\".*")); if (treeMode) { node = new QTreeWidgetItem(mcrNode, lastMcrNode); lastMcrNode = node; } else node = new QTreeWidgetItem(symbols); node->setText(0, stripped); node->setIcon(0, QIcon(mcr)); node->setText(1, QString::number( i, 10)); } if(cl.indexOf(QRegExp("^<xsl:variable ")) == 0 && struct_on) { QString stripped = cl.remove(QRegExp("^<xsl:variable +name=\"")); stripped = stripped.remove(QRegExp("\".*")); if (treeMode) { node = new QTreeWidgetItem(sctNode, lastSctNode); lastSctNode = node; } else node = new QTreeWidgetItem(symbols); node->setText(0, stripped); node->setIcon(0, QIcon(sct)); node->setText(1, QString::number( i, 10)); } if(cl.indexOf(QRegExp("^<xsl:template +match=")) == 0 && func_on) { QString stripped = cl.remove(QRegExp("^<xsl:template +match=\"")); stripped = stripped.remove(QRegExp("\".*")); if (treeMode) { node = new QTreeWidgetItem(clsNode, lastClsNode); lastClsNode = node; } else node = new QTreeWidgetItem(symbols); node->setText(0, stripped); node->setIcon(0, QIcon(cls_int)); node->setText(1, QString::number( i, 10)); } if(cl.indexOf(QRegExp("^<xsl:template +name=")) == 0 && func_on) { QString stripped = cl.remove(QRegExp("^<xsl:template +name=\"")); stripped = stripped.remove(QRegExp("\".*")); if (treeMode) { node = new QTreeWidgetItem(clsNode, lastClsNode); lastClsNode = node; } else node = new QTreeWidgetItem(symbols); node->setText(0, stripped); node->setIcon(0, QIcon(cls)); node->setText(1, QString::number( i, 10)); } if(cl.indexOf(QRegExp("<xsl:template")) >= 0) { templ = 1; } } }
std::auto_ptr<strCopyTst> get_strCopyTst() { std::auto_ptr<strCopyTst> sct(new strCopyTst); sct->myString = "woohoo"; return sct; }