enigma-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Enigma-cvs] enigma/src enigma.hh,1.19,1.20 enigma.cc,1.28,1.29


From: Daniel Heck <address@hidden>
Subject: [Enigma-cvs] enigma/src enigma.hh,1.19,1.20 enigma.cc,1.28,1.29
Date: Sat, 01 Nov 2003 23:44:36 +0000

Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv28203/src

Modified Files:
        enigma.hh enigma.cc 
Log Message:
new operator<< for GridPos


Index: enigma.hh
===================================================================
RCS file: /cvsroot/enigma/enigma/src/enigma.hh,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** enigma.hh   20 Oct 2003 08:05:45 -0000      1.19
--- enigma.hh   1 Nov 2003 23:44:34 -0000       1.20
***************
*** 193,196 ****
--- 193,198 ----
      };
  
+     std::ostream& operator<<(std::ostream& os, const GridPos& val);
+ 
      inline void GridPos::move(Direction dir) {
          switch(dir) {

Index: enigma.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/enigma.cc,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** enigma.cc   27 Oct 2003 11:53:17 -0000      1.28
--- enigma.cc   1 Nov 2003 23:44:34 -0000       1.29
***************
*** 301,307 ****
  }
  
! //----------------------------------------------------------------------
! // Timer
! //----------------------------------------------------------------------
  
  namespace enigma
--- 301,313 ----
  }
  
! /* -------------------- GridPos -------------------- */
! 
! std::ostream& enigma::operator<<(std::ostream& os, const GridPos& val)
! {
!     return os << '(' << val.x << ',' << val.y << ')';
! }
! 
! 
! /* -------------------- Timer -------------------- */
  
  namespace enigma
***************
*** 335,341 ****
  {}
  
! void
! Alarm::tick(double dtime)
! {
      if (!removed) {
          timeleft -= dtime;
--- 341,345 ----
  {}
  
! void Alarm::tick(double dtime) {
      if (!removed) {
          timeleft -= dtime;
***************
*** 351,356 ****
  }
  
! Timer::Timer() : rep(*new Rep)
! {}
  
  Timer::~Timer() {
--- 355,360 ----
  }
  
! Timer::Timer() : rep(*new Rep) {
! }
  
  Timer::~Timer() {
***************
*** 358,368 ****
  }
  
! void
! Timer::deactivate(TimeHandler* th)
! {
!     // This doesn't work: Some objects deactivate themselves from their
!     // `tick' method!
!     //    rep.handlers.remove(th);
! 
      std::list<TimeHandler*>::iterator i;
  
--- 362,366 ----
  }
  
! void Timer::deactivate(TimeHandler* th) {
      std::list<TimeHandler*>::iterator i;
  
***************
*** 371,393 ****
          *i = 0;
      }
  }
  
! void
! Timer::activate(TimeHandler *th)
! {
      if (find(rep.handlers.begin(), rep.handlers.end(), th) == 
rep.handlers.end())
          rep.handlers.push_back(th);
  }
  
! void
! Timer::set_alarm(TimeHandler *th, double interval, bool repeatp)
! {
      if (interval > 0)
          rep.alarms.push_back(Alarm(th, interval, repeatp));
  }
  
! void
! Timer::remove_alarm(TimeHandler *th)
! {
      // does not work (crashes if alarm_n removed alarm_n+1)
      // rep.alarms.remove(Alarm(th,0,0));
--- 369,388 ----
          *i = 0;
      }
+     //    rep.handlers.remove(th);
+     // This doesn't work because some objects deactivate themselves
+     // from their `tick' method!
  }
  
! void Timer::activate(TimeHandler *th) {
      if (find(rep.handlers.begin(), rep.handlers.end(), th) == 
rep.handlers.end())
          rep.handlers.push_back(th);
  }
  
! void Timer::set_alarm(TimeHandler *th, double interval, bool repeatp) {
      if (interval > 0)
          rep.alarms.push_back(Alarm(th, interval, repeatp));
  }
  
! void Timer::remove_alarm(TimeHandler *th) {
      // does not work (crashes if alarm_n removed alarm_n+1)
      // rep.alarms.remove(Alarm(th,0,0));
***************
*** 401,407 ****
  
  
! void
! Timer::tick(double dtime)
! {
      rep.handlers.remove(0);     // remove inactive entries
      for_each(rep.handlers.begin(), rep.handlers.end(),
--- 396,400 ----
  
  
! void Timer::tick(double dtime) {
      rep.handlers.remove(0);     // remove inactive entries
      for_each(rep.handlers.begin(), rep.handlers.end(),
***************
*** 419,425 ****
  
  
! void
! Timer::clear()
! {
      rep.handlers.clear();
      rep.alarms.clear();
--- 412,416 ----
  
  
! void Timer::clear() {
      rep.handlers.clear();
      rep.alarms.clear();





reply via email to

[Prev in Thread] Current Thread [Next in Thread]