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>
23 #include "overviewmap.h"
24 #include "input-events.h"
29 //! Draw a Quest objective onto a miniature map graphic.
31 * This is a map where you can depict a Quest.
32 * The depiction is different for each kind of Quest (Quest::Type).
34 * @note This class is also used in a special case to depict the quest
35 * completion when the reward is a hidden ruin (Reward::RUIN).
37 class QuestMap : public OverviewMap
41 //! Default constructor. Make a new QuestMap.
43 * @param quest The quest to depict on the miniature map graphic.
45 QuestMap(Quest *quest);
50 //! Point to another position on the miniature map graphic.
52 * @note This is used to point to a hidden map Reward after a Quest has
55 void set_target(Vector<int>target){ d_target = target;}
60 //! Emitted when the quest is finished being drawn on the map surface.
62 * Classes that use QuestMap must catch this signal to display the map.
64 sigc::signal<void, Glib::RefPtr<Gdk::Pixmap> > map_changed;
68 //! Draw the given positions on the map in the colour of the given player.
69 void draw_stacks(Player *p, std::list< Vector<int> > targets);
71 //! Draw a line to a boxed target.
72 void draw_target(Vector<int> start, Vector<int> target);
74 //! Draw a box around a target.
77 //! Draw the Quest onto the miniature map graphic.
79 * This method is automatically called by the QuestMap::draw method.
80 * Either draws the given stacks, a line to a target with a target, or a
81 * target, or nothing at all depending on the kind of Quest.
83 virtual void after_draw();
87 //! The Quest to depict on the miniature map graphic.
90 //! The new position to point to on the miniature map graphic.