[Bastion-cvs] bastion/src/util EventDispatcher.cpp,1.3,1.4 EventDispatcher.h,1.9,1.10
Brought to you by:
jacek_kolodziej
|
From: Jacek K. <jac...@us...> - 2004-06-30 13:52:48
|
Update of /cvsroot/bastion/bastion/src/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28722/src/util Modified Files: EventDispatcher.cpp EventDispatcher.h Log Message: - krok w kierunku umozliwienia istnienia swiata, bez istnienia jego wizualizacji: przeniesienie EventDispatchera z klasy GameView do statycznego pola klasy EventDispatcher. Aby pobrac EventDispatchera wystarczy teraz wywolac EvnetDispatcher::get(). Pozostaje jeszcze zrobic tak aby figurki w UnitHandlerze i InformationCollectorze byly przypisywane z zewnatrz. Index: EventDispatcher.h =================================================================== RCS file: /cvsroot/bastion/bastion/src/util/EventDispatcher.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** EventDispatcher.h 26 May 2004 11:50:46 -0000 1.9 --- EventDispatcher.h 30 Jun 2004 13:52:38 -0000 1.10 *************** *** 58,64 **** --- 58,68 ---- ~EventDispatcher(); + /// Pobiera jedyna instancje tego obiektu. + static EventDispatcher* get(); protected: + static EventDispatcher *theOnlyOneDispatcher; + /// Tablica kolejek. Po jednej kolejce dla kazdego rodzaju eventa. EventListenersQueue **queue; Index: EventDispatcher.cpp =================================================================== RCS file: /cvsroot/bastion/bastion/src/util/EventDispatcher.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** EventDispatcher.cpp 26 May 2004 11:50:46 -0000 1.3 --- EventDispatcher.cpp 30 Jun 2004 13:52:38 -0000 1.4 *************** *** 18,21 **** --- 18,23 ---- #include <iostream> + EventDispatcher * EventDispatcher::theOnlyOneDispatcher = NULL; + EventDispatcher::~EventDispatcher() { *************** *** 63,65 **** --- 65,74 ---- } + EventDispatcher * EventDispatcher::get( ) + { + if(theOnlyOneDispatcher==NULL) + theOnlyOneDispatcher = new EventDispatcher(); + return theOnlyOneDispatcher; + } + |