1
// Copyright (C) 2007, 2008 Ben Asselstine
1
3
// This program is free software; you can redistribute it and/or modify
2
4
// it under the terms of the GNU General Public License as published by
3
5
// the Free Software Foundation; either version 2 of the License, or
11
13
// You should have received a copy of the GNU General Public License
12
14
// along with this program; if not, write to the Free Software
13
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26
/** Display of the whole game map.
28
* This is a map where you can see a quest.
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).
31
37
class QuestMap : public OverviewMap
40
//! Default constructor. Make a new QuestMap.
42
* @param quest The quest to depict on the miniature map graphic.
44
QuestMap(Quest *quest);
36
// emitted when the map surface has changed
46
//! Emitted when the quest is finished being drawn on the map surface.
48
* Classes that use QuestMap must catch this signal to display the map.
37
50
sigc::signal<void, SDL_Surface *> map_changed;
39
void set_target(Vector<int>target);
52
//! Point to another position on the miniature map graphic.
54
* @note This is used to point to a hidden map Reward after a Quest has
57
void set_target(Vector<int>target){ d_target = target;}
60
//! The Quest to depict on the miniature map graphic.
63
//! Draw the given positions on the map in the colour of the given player.
43
64
void draw_stacks(Player *p, std::list< Vector<int> > targets);
66
//! Draw a line to a boxed target.
44
67
void draw_target(Vector<int> start, Vector<int> target);
69
//! Draw a box around a target.
45
70
void draw_target();
72
//! The new position to point to on the miniature map graphic.
47
73
Vector<int> d_target;
48
// hook from base class
76
//! Draw the Quest onto the miniature map graphic.
78
* This method is automatically called by the QuestMap::draw method.
79
* Either draws the given stacks, a line to a target with a target, or a
80
* target, or nothing at all depending on the kind of Quest.
49
82
virtual void after_draw();