1
// Copyright (C) 2010 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>
23
#include "overviewmap.h"
24
#include "input-events.h"
29
//! Draw a miniature map graphic with an indication of where items are.
31
* This draws stacks that have heroes that have items, as well as bags that
32
* are dropped onto the map.
34
class ItemMap : public OverviewMap
37
//! Default constructor. Make a new ItemMap.
39
* @param item_laden_stacks A list of stacks that contain at least one
40
* hero that has at least one item.
41
* @param bags A list of mapbackpack objects, which are bags
42
* of stuff dropped on the map.
44
ItemMap(std::list<Stack*> item_laden_stacks, std::list<MapBackpack*> bags);
46
//! Emitted when the icons are finished being drawn on the map surface.
48
* Classes that use ItemMap must catch this signal to display the map.
50
sigc::signal<void, Glib::RefPtr<Gdk::Pixmap> > map_changed;
53
//! The bags to draw bag icons for.
54
std::list<MapBackpack *>bags;
56
//! The item laden stacks to draw hero icons for.
57
std::list<Stack *>stacks;
59
//! Draw the bag icons on the miniature map graphic.
62
//! Draw a bag icon at the given tile on the miniature map graphic.
63
void draw_bag(Vector<int> pos);
65
//! Draw the hero icons on the miniature map graphic.
68
//! Draw the hero and bag icons onto the miniature map graphic.
70
* This draws the shields for each city as well as icons to indicate
71
* where the items are.
73
* This method is automatically called by the ItemMap::draw method.
75
virtual void after_draw();