[Bastion-cvs] bastion/src/interface GameView.cpp,1.47,1.48 GameView.h,1.25,1.26
Brought to you by:
jacek_kolodziej
|
From: Jacek K. <jac...@us...> - 2004-06-30 13:52:46
|
Update of /cvsroot/bastion/bastion/src/interface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28722/src/interface Modified Files: GameView.cpp GameView.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: GameView.cpp =================================================================== RCS file: /cvsroot/bastion/bastion/src/interface/GameView.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** GameView.cpp 4 Jun 2004 20:21:44 -0000 1.47 --- GameView.cpp 30 Jun 2004 13:52:37 -0000 1.48 *************** *** 64,68 **** GameView::~GameView() { ! eventDispatcher->unregisterListener(this); delete worldView; GUIView::destroyInstance(); --- 64,68 ---- GameView::~GameView() { ! EventDispatcher::get()->unregisterListener(this); delete worldView; GUIView::destroyInstance(); *************** *** 73,77 **** GameView::GameView( ) { ! eventDispatcher = new EventDispatcher(); } --- 73,77 ---- GameView::GameView( ) { ! } *************** *** 87,91 **** canManipulateTeams = true; ! eventDispatcher->registerListener(EventDispatcher::ETeamEvents, this); continueRunning = true; --- 87,91 ---- canManipulateTeams = true; ! EventDispatcher::get()->registerListener(EventDispatcher::ETeamEvents, this); continueRunning = true; *************** *** 237,241 **** /// wydawanie rozkazu move potrzebuje klikniecia /// na mapie dokad trzeba isc ! eventDispatcher->dispatch( EventDispatcher::EOnMapMouseClick, new EventOnMapMouseClick(x/16,y/16)); --- 237,241 ---- /// wydawanie rozkazu move potrzebuje klikniecia /// na mapie dokad trzeba isc ! EventDispatcher::get()->dispatch( EventDispatcher::EOnMapMouseClick, new EventOnMapMouseClick(x/16,y/16)); *************** *** 387,391 **** std::cout << "new active team: " << (int) t << "\n"; activeTeam = t; ! eventDispatcher->dispatch(EventDispatcher::ETeamEvents, new EventActiveTeamChanged(t)); } --- 387,391 ---- std::cout << "new active team: " << (int) t << "\n"; activeTeam = t; ! EventDispatcher::get()->dispatch(EventDispatcher::ETeamEvents, new EventActiveTeamChanged(t)); } Index: GameView.h =================================================================== RCS file: /cvsroot/bastion/bastion/src/interface/GameView.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** GameView.h 27 May 2004 18:26:38 -0000 1.25 --- GameView.h 30 Jun 2004 13:52:37 -0000 1.26 *************** *** 92,96 **** WorldView* getWorldView() { return worldView; } ! EventDispatcher* getEventDispatcher() {return eventDispatcher;} void setActiveTeam(Team *t); --- 92,97 ---- WorldView* getWorldView() { return worldView; } ! // EvnetDispatcher przeniesiony do EventDispatcher::get(). ! // EventDispatcher* getEventDispatcher() {return eventDispatcher;} void setActiveTeam(Team *t); *************** *** 104,108 **** protected: ! EventDispatcher *eventDispatcher; bool canManipulateTeams; // true jesli mozna manipulowac druzynami. --- 105,109 ---- protected: ! // EventDispatcher *eventDispatcher; bool canManipulateTeams; // true jesli mozna manipulowac druzynami. |