source/Controller/LifeGameController.h
Go to the documentation of this file.
00001 
00005 #ifndef __LIFEGAME_CONTROLLER_H__
00006 #define __LIFEGAME_CONTROLLER_H__
00007 
00008 #include "../Model/MatrixCell.h"
00009 #include "../View/LifeGameViewOnCurses.h"
00010 #include "../Lib/CellAttribute.h"
00011 
00016 class LifeGameController
00017 {
00018 public:
00019 
00023     enum LIFEGAME_EVENT {
00024         EV_NONE,
00025         EV_QUIT,
00026         EV_PAUSE,
00027         EV_START,
00028         EV_MOVE_UP_CURSOR,
00029         EV_MOVE_LOW_CURSOR,
00030         EV_MOVE_RIGHT_CURSOR,
00031         EV_MOVE_LEFT_CURSOR,
00032                 EV_PLOTCELL,
00033         EV_MAX,
00034     };
00035 
00039     LifeGameController();
00040 
00044     virtual ~LifeGameController();
00045 
00051         void initialPlot();
00052 
00058         LIFEGAME_EVENT eventLoop();
00059 
00066         LIFEGAME_EVENT getEvent();
00067 
00073         void nop(){ }
00074 
00080         void refreshCell();
00081 
00087         void moveToUpper();
00088 
00094         void moveToLower();
00095 
00101         void moveToRight();
00102 
00108         void moveToLeft();
00109 
00115         void plotCell();
00116 
00122         void syncStateModelToView();
00123 
00124 private:
00128         MatrixCell*                             m_pcLifeGameModel;
00129 
00133         LifeGameViewOnCurses*   m_pcLifeGameView;
00134 
00138         LIFEGAME_EVENT m_ePrevEvent;
00139 };
00140 
00141 #endif  // __LIFEGAME_CONTROLLER_H__
00142 
 All Classes Files Functions Variables Enumerations Enumerator Defines