src/tron/gCycleMovement.h

Go to the documentation of this file.
00001 /*
00002 
00003 *************************************************************************
00004 
00005 ArmageTron -- Just another Tron Lightcycle Game in 3D.
00006 Copyright (C) 2004  Armagetron Advanced Team (http://sourceforge.net/projects/armagetronad/)
00007 
00008 **************************************************************************
00009 
00010 This program is free software; you can redistribute it and/or
00011 modify it under the terms of the GNU General Public License
00012 as published by the Free Software Foundation; either version 2
00013 of the License, or (at your option) any later version.
00014 
00015 This program is distributed in the hope that it will be useful,
00016 but WITHOUT ANY WARRANTY; without even the implied warranty of
00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018 GNU General Public License for more details.
00019 
00020 You should have received a copy of the GNU General Public License
00021 along with this program; if not, write to the Free Software
00022 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00023 
00024 ***************************************************************************
00025 
00026 */
00027 
00028 #ifndef     ARMAGETRONAD_SRC_TRON_GCYCLEMOVEMENT_H_INCLUDED
00029 #define     ARMAGETRONAD_SRC_TRON_GCYCLEMOVEMENT_H_INCLUDED
00030 
00031 #include "eNetGameObject.h"
00032 #include <deque>
00033 
00034 class gCycle;
00035 class gDestination;
00036 class gPlayerWall;
00037 class gCycleMovement;
00038 class gSensor;
00039 struct gMaxSpaceAheadHitInfo;
00040 
00042 class gMaxSpaceAheadHitInfoClearer
00043 {
00044 public:
00045     gMaxSpaceAheadHitInfoClearer( gMaxSpaceAheadHitInfo * & info );
00046     ~gMaxSpaceAheadHitInfoClearer();
00047 private:
00048     gMaxSpaceAheadHitInfo * & info_;
00049 };
00050 
00051 REAL GetTurnSpeedFactor(void);
00052 
00053 class gEnemyInfluence{
00054 private:
00055     nObserverPtr< ePlayerNetID >        lastEnemyInfluence;     // the last enemy wall we encountered
00056     REAL                                                        lastTime;                               // the time it was drawn at
00057 
00058 public:
00059     gEnemyInfluence();
00060 
00061     ePlayerNetID const *            GetEnemy() const;       // the last enemy possibly responsible for our death
00062     REAL                            GetTime() const;        // the time of the influence
00063     void                                                        AddSensor( const gSensor& sensor, REAL timePenalty, gCycleMovement * thisCycle ); // add the result of the sensor scan to our data
00064     void                                                        AddWall( const eWall * wall, eCoord const & point, REAL timePenalty, gCycleMovement * thisCycle ); // add the interaction with a wall to our data
00065     void                                                        AddWall( const gPlayerWall * wall, REAL timeBuilt, gCycleMovement * thisCycle ); // add the interaction with a wall to our data
00066 };
00067 
00068 struct gRealColor {
00069     REAL r,g,b;
00070 
00071     gRealColor():r(1), g(1), b(1){}
00072 
00073 };
00074 
00076 class gCycleMovement : public eNetGameObject
00077 {
00078 public:
00079     // accessors
00080     static float            RubberSpeed             ()                                              ;   
00081     static float            SpeedMultiplier         ()                                              ;   
00082     static void             SetSpeedMultiplier      ( REAL                  mult        )           ;   
00083     static float            MaximalSpeed            ()                                              ;   
00084 
00085     // AI info
00086     int                         WindingNumber           ()                                    const     ;   
00087     void                        SetWindingNumberWrapped ( int newWindingNumberWrapped )                 ;   
00088 
00089     // information about physics state
00090     virtual eCoord          Direction               ()                                    const     ;   
00091     virtual eCoord          LastDirection           ()                                    const     ;   
00092     virtual REAL            Speed                   ()                                    const     ;   
00093     virtual bool            Alive                   ()                                    const     ;   
00094     virtual bool            Vulnerable              ()                                    const     ;   
00095     virtual eCoord          SpawnDirection         ()                                    const     ;   
00096 
00097     bool                    CanMakeTurn             (int direction                      ) const     ;   
00098     bool                    CanMakeTurn             ( REAL time, int direction          ) const     ;   
00099     inline  REAL            GetDistanceSinceLastTurn(                                   ) const     ;   
00100     REAL                    GetTurnDelay            (                                   ) const     ;   
00101     REAL                    GetTurnDelayDb          (                                   ) const     ;   
00102     REAL                    GetNextTurn             (int direction                                   ) const     ;   
00103 
00104     // destination handling
00105     void                    AddDestination          ()                                              ;   
00106     void                    AdvanceDestination      ()                                              ;   
00107     void                    AddDestination          ( gDestination *        dest        )           ;   
00108     gDestination*           GetCurrentDestination   ()                                    const     ;   
00109     void                    NotifyNewDestination    ( gDestination *        dest        )           ;   
00110     bool                    IsDestinationUsed       ( const gDestination *  dest        ) const     ;   
00111 
00112     inline void            DropTempWall             ( gPlayerWall *         wall
00113             ,                                         eCoord const &        pos
00114             ,                                         eCoord const &        dir         )           ;   
00115     // information query
00116     virtual bool            EdgeIsDangerous         ( const eWall *         wall
00117             ,                                         REAL                  time
00118             ,                                         REAL                  alpha       ) const     ;   
00119 
00120     // movement commands
00121     bool                    Turn                    ( REAL                  dir         )           ;   
00122     bool                    Turn                    ( int                   dir         )           ;   
00123 
00124     void                    MoveSafely              (const eCoord &         dest
00125             ,                                        REAL                   startTime
00126             ,                                        REAL                   endTime     )           ;   
00127 
00128     virtual bool            Timestep                ( REAL                  currentTime )           ;   
00129 
00130     virtual REAL            NextInterestingTime     () const                                        ;   
00131 
00132     // existence management
00133     virtual void            AddRef                  ()                                              ;   
00134 
00135     gCycleMovement                                  ( eGrid *               grid
00136             ,                                         const eCoord &        pos
00137             ,                                         const eCoord &        dir
00138             ,                                         ePlayerNetID *        p=NULL
00139                     ,                                 bool                  autodelete=1 )          ;   
00140     gCycleMovement                                  ( nMessage &            message      )          ;   
00141     virtual ~gCycleMovement                         ()                                              ;   
00142     virtual void OnRemoveFromGame(); // called when the cycle is physically removed from the game
00143 
00144     void RequestSync(bool ack=true);     
00145     void RequestSync(int user,bool ack); 
00146 protected:
00148     struct SyncData
00149     {
00150         eCoord pos, dir, lastTurn;
00151         REAL distance, speed, time, rubber, rubberMalus, brakingReservoir;
00152         unsigned short turns,braking,messageID;
00153 
00154         SyncData()
00155                 :distance(0), speed(0), time(-10000), rubber(0), rubberMalus(0), brakingReservoir(0)
00156                 ,turns(0),braking(0),messageID(0)
00157         {}
00158     };
00159 
00160     void            CopyFrom                        ( const gCycleMovement & other      )           ;   
00161 
00162     void            CopyFrom                        ( const SyncData &       sync
00163             ,                                         const gCycleMovement & other      )           ;   
00164 
00165     virtual void            InitAfterCreation       ()                                              ;   
00166 
00167     // acceleration handling
00168     virtual void            AccelerationDiscontinuity ()                                            ;   
00169     virtual void            CalculateAcceleration   (                                   )           ;   
00170     virtual void            ApplyAcceleration       ( REAL                  dt          )           ;   
00171 
00172     // destination handling
00173     REAL                    DistanceToDestination   ( gDestination &        dest        ) const     ;   
00174     virtual void            OnNotifyNewDestination  ( gDestination *        dest        )           ;   
00175     virtual void            OnDropTempWall          ( gPlayerWall *         wall
00176             ,                                         eCoord const &        pos
00177             ,                                         eCoord const &        dir         )           ;   
00178     virtual bool            DoIsDestinationUsed     ( const gDestination *  dest        ) const     ;   
00179     static  gDestination*   GetDestinationBefore    ( const SyncData &      sync
00180             ,                                         gDestination*         first       )                   ;   
00181 
00182     virtual bool            DoTurn                  ( int                   dir         )           ;   
00183     virtual REAL            DoGetDistanceSinceLastTurn  (                               ) const     ;   
00184 
00185     virtual void            RightBeforeDeath        ( int                   numTries    )           ;   
00186     virtual void            Die                     ( REAL time                         )           ;  
00187 
00188     virtual bool            TimestepCore            ( REAL                  currentTime
00189             ,                                         bool                  calculateAcceleration = true )           ;   
00190 private:
00191     void                    MyInitAfterCreation     ()                                              ;   
00192 
00193     //      void            Init_gCycleCore         ()                                              ;   //!< initialisation function
00194     //      void            Finit_gCycleCore        ()                                              ;   //!< finalisation function
00195 
00196     gCycleMovement                                  ()                                              ;   
00197     gCycleMovement                                  ( gCycleMovement const & other      )           ;   
00198     gCycleMovement& operator =                      ( gCycleMovement const & other      )           ;   
00199 
00200 private:
00201     short           alive_;                     
00202 
00203 protected:
00204     gEnemyInfluence                             enemyInfluence; 
00205 
00206     gDestination*   destinationList;            
00207     gDestination*   currentDestination;         
00208     gDestination*   lastDestination;            
00209 
00210     eCoord          dirDrive;                   
00211     eCoord          dirSpawn;                   
00212     eCoord          lastDirDrive;               
00213     REAL            acceleration;               
00214     REAL            totalZoneAcceleration;      
00215 
00216     REAL            lastTimestep_;              
00217     REAL            verletSpeed_;               
00218 
00219     REAL            distance;                   
00220     // REAL         wallContDistance;           //!< distance at which the walls will start to build up ( negative if the wall is already building )
00221 
00222     mutable bool    refreshSpaceAhead_;         
00223     REAL            maxSpaceMaxCast_;           
00224     mutable gMaxSpaceAheadHitInfo * maxSpaceHit_; 
00225 
00226     unsigned short  turns;                      
00227     unsigned short  braking;                    
00228 
00229     int             windingNumber_;             
00230     int             windingNumberWrapped_;      
00231 
00232     mutable REAL    gap_[2];                    
00233     mutable bool    keepLookingForGap_[2];      
00234 
00235     eCoord                      lastTurnPos_;               
00236     REAL            lastTurnTimeRight_;         
00237     REAL            lastTurnTimeLeft_;          
00238     REAL            lastTimeAlive_;             
00239     std::deque<int> pendingTurns;               
00240 
00241     REAL            brakingReservoir;           
00242     REAL            rubber;                     
00243     REAL            rubberMalus;                
00244     REAL            rubberSpeedFactor;          
00245 
00246     REAL            brakeUsage;                 
00247     REAL            rubberUsage;                
00248 
00249     // room for accessors
00250 public:
00251     REAL GetMaxSpaceAhead( REAL maxReport ) const; //< Returns the current maximal space ahead
00252 
00253     inline REAL GetDistance( void ) const;  
00254     inline gCycleMovement const & GetDistance( REAL & distance ) const; 
00255     inline REAL GetRubber( void ) const;    
00256     inline gCycleMovement const & GetRubber( REAL & rubber ) const; 
00257     inline unsigned short GetTurns( void ) const;   
00258     inline gCycleMovement const & GetTurns( unsigned short & turns ) const; 
00259     inline unsigned short GetBraking( void ) const; 
00260     inline gCycleMovement const & GetBraking( unsigned short & braking ) const; 
00261     inline REAL GetBrakingReservoir( void ) const;      
00262     inline gCycleMovement const & GetBrakingReservoir( REAL & brakingReservoir ) const; 
00263     inline REAL GetRubberMalus( void ) const;   
00264     inline gCycleMovement const & GetRubberMalus( REAL & rubberMalus ) const;   
00265     static bool RubberMalusActive( void ) ; 
00266     inline eCoord const & GetLastTurnPos( void ) const; 
00267     inline gCycleMovement const & GetLastTurnPos( eCoord & lastTurnPos ) const; 
00268     inline REAL const & GetLastTurnTime( void ) const;  
00269     inline gCycleMovement const & GetLastTurnTime( REAL & lastTurnTime ) const; 
00270     REAL GetAcceleration(void) const  { return acceleration; };  
00271     virtual void            AddZoneAcceleration     ( REAL zoneAcceleration             )           ;
00272 
00273 protected:
00274     inline gCycleMovement & SetLastTurnPos( eCoord const & lastTurnPos );       
00275     inline gCycleMovement & SetLastTurnTime( REAL const & lastTurnTime );       
00276 private:
00277     inline gCycleMovement & SetDistance( REAL distance );   
00278 public:  // HACK
00279     //To have the zone able to influence it
00280     inline gCycleMovement & SetRubber( REAL rubber );   
00281 private: // END OF HACK
00282     inline gCycleMovement & SetTurns( unsigned short turns );   
00283     inline gCycleMovement & SetBraking( unsigned short braking );   
00284 public:  // HACK
00285     //To have the zone able to influence it
00286     inline gCycleMovement & SetBrakingReservoir( REAL brakingReservoir );       
00287 private: // END OF HACK
00288     inline gCycleMovement & SetRubberMalus( REAL rubberMalus ); 
00289 };
00290 
00292 // float MaxSpaceAhead( const gCycleMovement* cycle, float ts, float lookAhead, float maxReport );
00293 
00295 class gCycleDeath: public eDeath
00296 {
00297 public:
00298     gCycleDeath( eCoord const & pos )
00299             : pos_(pos)
00300     {}
00301 
00302     eCoord pos_;
00303 };
00304 
00306 class gCycleStop: public eDeath
00307 {
00308 };
00309 
00310 // this class describes a point on the map the cycle on another
00311 // computer of the game IS at. The copies of the cycle on the
00312 // other computers try to reach this position by making the right
00313 // turns.
00314 class gDestination{
00315     friend class gCycleMovement;
00316     friend class gCycle;                                // todo: remove me
00317     friend class gCycleExtrapolator;    // todo: remove me
00318 
00319     eCoord position;                    // position of turn/brake command
00320     eCoord direction;                   // driving direction after the command
00321     REAL  gameTime;                             // game time of the command
00322     REAL  distance;                             // distance travelled so far
00323     REAL  speed;                                // speed at the time of the command
00324     bool  braking;                              // flag telling whether the brake was active
00325     bool  chatting;                             // flag indicating chat status
00326 
00327     unsigned short turns;       // the number of turns taken by the cycle so far
00328     bool hasBeenUsed;                   // flag indicating whether the sync code has already used this command
00329     unsigned short messageID;   // ID of the message this command came from
00330     bool missable;              // flag indicating that this destination is not to be treated as the one after a missed destination
00331 
00332     gDestination *next; // so they can form a list
00333     gDestination **list; // the list we are in
00334 public:
00335     // take pos,dir and time from a cycle
00336     explicit gDestination(const gCycleMovement &takeitfrom);
00337     explicit gDestination(const gCycle &takeitfrom);
00338 
00339     // or from a message
00340     explicit gDestination( nMessage &m, unsigned short & cycle_id );
00341 
00342     // take pos,dir and time from a cycle
00343     void CopyFrom(const gCycleMovement &other);
00344     void CopyFrom(const gCycle &other);
00345 
00347     int CompareWith( const gDestination& other ) const;
00348 
00349     // write all the data into a nMessage
00350     void WriteCreate( nMessage &m, unsigned short cycle_id );
00351 
00352     // insert yourself into a list ordered by distance
00353     void InsertIntoList(gDestination **list);
00354 
00355     // find the latest entry in a list before the given distance
00356     static gDestination *RightBefore(gDestination *list, REAL dist);
00357 
00358     // find the earliest entry in a list after the given distance
00359     static gDestination *RightAfter(gDestination *list, REAL dist);
00360 
00361     // remove yourself again
00362     void RemoveFromList();
00363 
00364     bool Chatting(){ return chatting; }
00365 
00366     ~gDestination(){RemoveFromList();}
00367 
00368     gDestination & SetGameTime( REAL gameTime );        
00369     REAL GetGameTime( void ) const;     
00370     gDestination const & GetGameTime( REAL & gameTime ) const;  
00371 };
00372 
00373 // *******************************************************************************************
00374 // *
00375 // *    IsDestinationUsed
00376 // *
00377 // *******************************************************************************************
00382 // *******************************************************************************************
00383 
00384 inline bool gCycleMovement::IsDestinationUsed( const gDestination * dest ) const
00385 {
00386     // delegate to virtual function
00387     return DoIsDestinationUsed( dest );
00388 }
00389 
00390 // *******************************************************************************************
00391 // *
00392 // *    DropTempWall
00393 // *
00394 // *******************************************************************************************
00400 // *******************************************************************************************
00401 
00402 inline void gCycleMovement::DropTempWall( gPlayerWall * wall, eCoord const & pos, eCoord const & dir )
00403 {
00404     this->OnDropTempWall( wall, pos, dir );
00405 }
00406 
00407 // *******************************************************************************************
00408 // *
00409 // *    GetDistance
00410 // *
00411 // *******************************************************************************************
00415 // *******************************************************************************************
00416 
00417 inline REAL gCycleMovement::GetDistance( void ) const
00418 {
00419     return this->distance;
00420 }
00421 
00422 // *******************************************************************************************
00423 // *
00424 // *    GetDistance
00425 // *
00426 // *******************************************************************************************
00431 // *******************************************************************************************
00432 
00433 inline gCycleMovement const & gCycleMovement::GetDistance( REAL & distance ) const
00434 {
00435     distance = this->distance;
00436     return *this;
00437 }
00438 
00439 // *******************************************************************************************
00440 // *
00441 // *    SetDistance
00442 // *
00443 // *******************************************************************************************
00448 // *******************************************************************************************
00449 
00450 inline gCycleMovement & gCycleMovement::SetDistance( REAL distance )
00451 {
00452     this->distance = distance;
00453     return *this;
00454 }
00455 
00456 // *******************************************************************************************
00457 // *
00458 // *    GetRubber
00459 // *
00460 // *******************************************************************************************
00464 // *******************************************************************************************
00465 
00466 inline REAL gCycleMovement::GetRubber( void ) const
00467 {
00468     return this->rubber;
00469 }
00470 
00471 // *******************************************************************************************
00472 // *
00473 // *    GetRubber
00474 // *
00475 // *******************************************************************************************
00480 // *******************************************************************************************
00481 
00482 inline gCycleMovement const & gCycleMovement::GetRubber( REAL & rubber ) const
00483 {
00484     rubber = this->rubber;
00485     return *this;
00486 }
00487 
00488 // *******************************************************************************************
00489 // *
00490 // *    SetRubber
00491 // *
00492 // *******************************************************************************************
00497 // *******************************************************************************************
00498 
00499 inline gCycleMovement & gCycleMovement::SetRubber( REAL rubber )
00500 {
00501     this->rubber = rubber;
00502     return *this;
00503 }
00504 
00505 // *******************************************************************************************
00506 // *
00507 // *    GetTurns
00508 // *
00509 // *******************************************************************************************
00513 // *******************************************************************************************
00514 
00515 inline unsigned short gCycleMovement::GetTurns( void ) const
00516 {
00517     return this->turns;
00518 }
00519 
00520 // *******************************************************************************************
00521 // *
00522 // *    GetTurns
00523 // *
00524 // *******************************************************************************************
00529 // *******************************************************************************************
00530 
00531 inline gCycleMovement const & gCycleMovement::GetTurns( unsigned short & turns ) const
00532 {
00533     turns = this->turns;
00534     return *this;
00535 }
00536 
00537 // *******************************************************************************************
00538 // *
00539 // *    SetTurns
00540 // *
00541 // *******************************************************************************************
00546 // *******************************************************************************************
00547 
00548 inline gCycleMovement & gCycleMovement::SetTurns( unsigned short turns )
00549 {
00550     this->turns = turns;
00551     return *this;
00552 }
00553 
00554 // *******************************************************************************************
00555 // *
00556 // *    GetBraking
00557 // *
00558 // *******************************************************************************************
00562 // *******************************************************************************************
00563 
00564 inline unsigned short gCycleMovement::GetBraking( void ) const
00565 {
00566     return this->braking;
00567 }
00568 
00569 // *******************************************************************************************
00570 // *
00571 // *    GetBraking
00572 // *
00573 // *******************************************************************************************
00578 // *******************************************************************************************
00579 
00580 inline gCycleMovement const & gCycleMovement::GetBraking( unsigned short & braking ) const
00581 {
00582     braking = this->braking;
00583     return *this;
00584 }
00585 
00586 // *******************************************************************************************
00587 // *
00588 // *    SetBraking
00589 // *
00590 // *******************************************************************************************
00595 // *******************************************************************************************
00596 
00597 inline gCycleMovement & gCycleMovement::SetBraking( unsigned short braking )
00598 {
00599     this->braking = braking;
00600     return *this;
00601 }
00602 
00603 // *******************************************************************************************
00604 // *
00605 // *    GetBrakingReservoir
00606 // *
00607 // *******************************************************************************************
00611 // *******************************************************************************************
00612 
00613 inline REAL gCycleMovement::GetBrakingReservoir( void ) const
00614 {
00615     return this->brakingReservoir;
00616 }
00617 
00618 // *******************************************************************************************
00619 // *
00620 // *    GetBrakingReservoir
00621 // *
00622 // *******************************************************************************************
00627 // *******************************************************************************************
00628 
00629 inline gCycleMovement const & gCycleMovement::GetBrakingReservoir( REAL & brakingReservoir ) const
00630 {
00631     brakingReservoir = this->brakingReservoir;
00632     return *this;
00633 }
00634 
00635 // *******************************************************************************************
00636 // *
00637 // *    SetBrakingReservoir
00638 // *
00639 // *******************************************************************************************
00644 // *******************************************************************************************
00645 
00646 inline gCycleMovement & gCycleMovement::SetBrakingReservoir( REAL brakingReservoir )
00647 {
00648     this->brakingReservoir = brakingReservoir;
00649     return *this;
00650 }
00651 
00652 // *******************************************************************************************
00653 // *
00654 // *    GetDistanceSinceLastTurn
00655 // *
00656 // *******************************************************************************************
00660 // *******************************************************************************************
00661 
00662 inline REAL gCycleMovement::GetDistanceSinceLastTurn( void ) const
00663 {
00664     return this->DoGetDistanceSinceLastTurn();
00665 }
00666 
00667 // *******************************************************************************************
00668 // *
00669 // *    getRubberMalus
00670 // *
00671 // *******************************************************************************************
00675 // *******************************************************************************************
00676 
00677 inline REAL gCycleMovement::GetRubberMalus( void ) const
00678 {
00679     return this->rubberMalus;
00680 }
00681 
00682 // *******************************************************************************************
00683 // *
00684 // *    getRubberMalus
00685 // *
00686 // *******************************************************************************************
00691 // *******************************************************************************************
00692 
00693 inline gCycleMovement const & gCycleMovement::GetRubberMalus( REAL & rubberMalus ) const
00694 {
00695     rubberMalus = this->rubberMalus;
00696     return *this;
00697 }
00698 
00699 // *******************************************************************************************
00700 // *
00701 // *    setRubberMalus
00702 // *
00703 // *******************************************************************************************
00708 // *******************************************************************************************
00709 
00710 inline gCycleMovement & gCycleMovement::SetRubberMalus( REAL rubberMalus )
00711 {
00712     this->rubberMalus = rubberMalus;
00713     return *this;
00714 }
00715 
00716 // *******************************************************************************************
00717 // *
00718 // *    GetLastTurnPos
00719 // *
00720 // *******************************************************************************************
00724 // *******************************************************************************************
00725 
00726 eCoord const & gCycleMovement::GetLastTurnPos( void ) const
00727 {
00728     return this->lastTurnPos_;
00729 }
00730 
00731 // *******************************************************************************************
00732 // *
00733 // *    GetLastTurnPos
00734 // *
00735 // *******************************************************************************************
00740 // *******************************************************************************************
00741 
00742 gCycleMovement const & gCycleMovement::GetLastTurnPos( eCoord & lastTurnPos ) const
00743 {
00744     lastTurnPos = this->lastTurnPos_;
00745     return *this;
00746 }
00747 
00748 // *******************************************************************************************
00749 // *
00750 // *    SetLastTurnPos
00751 // *
00752 // *******************************************************************************************
00757 // *******************************************************************************************
00758 
00759 gCycleMovement & gCycleMovement::SetLastTurnPos( eCoord const & lastTurnPos )
00760 {
00761     this->lastTurnPos_ = lastTurnPos;
00762     return *this;
00763 }
00764 
00765 // *******************************************************************************************
00766 // *
00767 // *    GetLastTurnTime
00768 // *
00769 // *******************************************************************************************
00773 // *******************************************************************************************
00774 
00775 REAL const & gCycleMovement::GetLastTurnTime( void ) const
00776 {
00777     return lastTurnTimeRight_ > lastTurnTimeLeft_ ? lastTurnTimeRight_ : lastTurnTimeLeft_;
00778 }
00779 
00780 // *******************************************************************************************
00781 // *
00782 // *    GetLastTurnTime
00783 // *
00784 // *******************************************************************************************
00789 // *******************************************************************************************
00790 
00791 gCycleMovement const & gCycleMovement::GetLastTurnTime( REAL & lastTurnTime ) const
00792 {
00793     lastTurnTime = GetLastTurnTime();
00794     return *this;
00795 }
00796 
00797 // *******************************************************************************************
00798 // *
00799 // *    SetLastTurnTime
00800 // *
00801 // *******************************************************************************************
00806 // *******************************************************************************************
00807 
00808 gCycleMovement & gCycleMovement::SetLastTurnTime( REAL const & lastTurnTime )
00809 {
00810     lastTurnTimeRight_ = lastTurnTimeLeft_ = lastTurnTime;
00811     return *this;
00812 }
00813 
00814 #endif // ARMAGETRONAD_SRC_TRON_GCYCLEMOVEMENT_H_INCLUDED

Generated on Sat Mar 15 22:56:07 2008 for Armagetron Advanced by  doxygen 1.5.4