~ubuntu-branches/ubuntu/trusty/enigma/trusty-proposed

« back to all changes in this revision

Viewing changes to src/stones/Turnstile.cc

  • Committer: Package Import Robot
  • Author(s): Erich Schubert
  • Date: 2013-04-06 14:54:02 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130406145402-jgjrtk7hac8gtvza
Tags: 1.20-dfsg.1-1
* New upstream release (Closes: #704595)
  (Repacked: dropped zipios++ source and main menu music)
* Update watch file, sf.net again.
* Fix documentation links (Closes: #653508)
* Conflict with enigma-level-previews to encourage deinstallation
  (Pregenerated level previews were only used with version 1.01)
* Use dh7 for building instead of CDBS
* Update to policy 3.9.4.0 (no changes)
* Register documentation with doc-base

Show diffs side-by-side

added added

removed removed

Lines of Context:
254
254
        std::vector<Actor*>::iterator iter = actorsInRange.begin(), end = actorsInRange.end();
255
255
        for (; iter != end; ++iter) {
256
256
            Actor *ac = *iter;
257
 
            
 
257
 
258
258
            if (ac->isMoribund())
259
259
                continue;
260
 
            
 
260
 
261
261
            const V2 &ac_center = ac->get_pos();
262
262
            GridPos   ac_pos(ac_center);
263
263
            int dx  = ac_pos.x-pv_pos.x;
332
332
                    const Direction impulse_dir[2][4] = {
333
333
                        // anticlockwise
334
334
                        { WEST, NORTH, EAST, SOUTH},
335
 
                        // clockwise                   
 
335
                        // clockwise
336
336
                        { NORTH, EAST, SOUTH, WEST},
337
337
                    };
338
338
 
410
410
    }
411
411
 
412
412
    void TurnstileArm::on_impulse(const Impulse& impulse) {
413
 
        enum Action { ROTL, ROTR, stay };
414
 
        static Action actions[4][4] = {
 
413
        enum ArmAction { ROTL, ROTR, stay };
 
414
        static ArmAction actions[4][4] = {
415
415
            { stay, ROTL, stay, ROTR }, // west arm
416
416
            { ROTR, stay, ROTL, stay }, // south arm
417
417
            { stay, ROTR, stay, ROTL }, // east arm
422
422
        TurnstilePivot *pivot = getPivot();
423
423
 
424
424
        if (pivot != NULL) {
425
 
            Action a = actions[state][impulse.dir];
 
425
            ArmAction a = actions[state][impulse.dir];
426
426
            if (a != stay) {
427
427
                bool clockwise = (a == ROTR);
428
428
                Actor *actor = dynamic_cast<Actor*>(impulse.sender);
466
466
        BootRegister(new TurnstileArm(NORTH), "st_turnstilearm_n");
467
467
    BOOT_REGISTER_END
468
468
 
469
 
 
470
469
} // namespace enigma
471