00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "MultiDrawer.h"
00010
00011
00012
00013
00014
00015 void
00016 MultiDrawer::acceptDrawer(Drawable *drawer)
00017 {
00018 m_drawers.push_back(drawer);
00019 }
00020
00021
00022
00023
00024
00025 void
00026 MultiDrawer::removeDrawer(const Drawable *drawer)
00027 {
00028 t_drawers::iterator end = m_drawers.end();
00029 for (t_drawers::iterator i = m_drawers.begin(); i != end; ++i) {
00030 if (*i == drawer) {
00031 m_drawers.erase(i);
00032 return;
00033 }
00034 }
00035 }
00036
00037
00038
00039
00040 void
00041 MultiDrawer::removeAll()
00042 {
00043 m_drawers.clear();
00044 }
00045
00046
00047
00048
00049 void
00050 MultiDrawer::drawOn(SDL_Surface *screen)
00051 {
00052 t_drawers::iterator end = m_drawers.end();
00053 for (t_drawers::iterator i = m_drawers.begin(); i != end; ++i) {
00054 (*i)->drawOn(screen);
00055 }
00056 }
00057