1 // Copyright (C) 2007, 2008, 2009 Ben Asselstine
3 // This program is free software; you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation; either version 3 of the License, or
6 // (at your option) any later version.
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU Library General Public License for more details.
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #include <sigc++/signal.h>
22 #include <sigc++/connection.h>
23 #include <sigc++/trackable.h>
25 #include "overviewmap.h"
26 #include "LocationList.h"
30 //! Draw the given cities and ruins on the map.
32 * Draw a set of cities and ruins onto the miniature map graphic.
34 * @note This is called HistoryMap because it is used for the HistoryDialog.
37 class HistoryMap: public OverviewMap
40 //! Default constructor. Make a new HistoryMap.
42 * @param clist The list of the City objects to draw on the miniature map.
44 HistoryMap(LocationList<City*> *clist, LocationList<Ruin*> *rlist);
46 //! Emitted when the cities are finished being drawn on the map surface.
48 * Classes that use HistoryMap must catch this signal to display the map.
50 sigc::signal<void, Glib::RefPtr<Gdk::Pixmap> > map_changed;
52 //! Change which cities are shown on the miniature map graphic.
54 * This method erases the cities that were previously drawn and shows
55 * a new set of City objects.
57 * @param clist The new list of City objects to draw onto the miniature
59 * @param rlist The new list of Ruin objects to draw onto the miniature
62 void updateCities (LocationList<City*> *clist, LocationList<Ruin*> *rlist);
66 //! The set of city objects to show on the miniature map graphic.
67 LocationList<City*> *d_clist;
69 //! The set of ruin objects to show on the miniature map graphic.
70 LocationList<Ruin*> *d_rlist;
72 //! Draw the City objects onto the miniature map graphic.
74 * This method is automatically called by the HistoryMap::draw method.
76 virtual void after_draw();
80 * This method iterates over the members of HistoryMap::d_clist and draws
81 * each city onto the minature map graphic.
83 * We can't use the OverviewMap::draw_cities method because it draws the
84 * City objects of Citylist, and not the set of cities defined here.