Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields

calendar.h

00001 /***************************************************************************
00002                           calendar.cpp  -  description
00003                              -------------------
00004     begin                : Wed April 7 2004
00005     copyright            : (C) 2004 by Daroth-U
00006     email                : daroth-u@ifrance.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef CALENDAR_H
00019 #define CALENDAR_H
00020 
00021 #include "constants.h"
00022 #include <iostream>
00023 #include <vector>    // STL for Vector
00024 #include "date.h"
00025 #include "events/event.h"
00026 
00027 // set to 1 to debug and to 0 to not debug
00028 #define CALENDAR_DEBUG 0
00029 #define MAX_SCHEDULED_EVENTS 500
00030 
00036 class Event;
00037 class Date;
00038 
00039 class Calendar {
00040  private:  
00041   
00042   static Calendar *instance;   
00043   
00044   Date currentDate;
00045   int timeMultiplicator;
00046   GLint lastTick; 
00047   bool timeFrozen; 
00048   
00049   vector<Event*> scheduledEvents;  
00050   
00051  public:
00052  
00053   static Calendar * getInstance();
00054   bool update(int gameSpeed);
00055   void setPause(bool mustPause);
00056   void setTimeMultiplicator(int t);
00057   void scheduleEvent(Event *e);
00058   void reset(bool resetTime=true);
00059   void cancelEvent(Event *e);
00060 
00061   // return date by value to avoid modification by other classes
00062   inline Date getCurrentDate() { return currentDate; }
00063     
00064   Calendar();
00065   ~Calendar();
00066   
00067 
00068  protected:
00069   
00070 
00071 
00072 };
00073 
00074 #endif

Generated on Thu Jun 16 21:50:42 2005 for scourge by  doxygen 1.4.0