~ubuntu-branches/ubuntu/trusty/lordsawar/trusty

« back to all changes in this revision

Viewing changes to src/questmap.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2008-06-17 16:07:00 UTC
  • mto: (5.1.1 lenny) (1.1.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20080617160700-6d8ofoz0qkasxlnw
ImportĀ upstreamĀ versionĀ 0.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Copyright (C) 2007, 2008 Ben Asselstine
 
2
//
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
10
12
//
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 
 
16
//  02110-1301, USA.
14
17
 
15
18
#ifndef QUESTMAP_H
16
19
#define QUESTMAP_H
23
26
 
24
27
class Quest;
25
28
 
26
 
/** Display of the whole game map.
27
 
  * 
28
 
  * This is a map where you can see a quest.
29
 
  */
30
 
 
 
29
//! Draw a Quest objective onto a miniature map graphic.
 
30
/** 
 
31
 * This is a map where you can depict a Quest.
 
32
 * The depiction is different for each kind of Quest (Quest::Type).
 
33
 *
 
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).
 
36
 */
31
37
class QuestMap : public OverviewMap
32
38
{
33
39
 public:
34
 
    QuestMap(Quest *q);
 
40
     //! Default constructor.  Make a new QuestMap.
 
41
     /**
 
42
      * @param quest  The quest to depict on the miniature map graphic.
 
43
      */
 
44
    QuestMap(Quest *quest);
35
45
 
36
 
    // emitted when the map surface has changed
 
46
    //! Emitted when the quest is finished being drawn on the map surface.
 
47
    /**
 
48
     * Classes that use QuestMap must catch this signal to display the map.
 
49
     */
37
50
    sigc::signal<void, SDL_Surface *> map_changed;
38
51
    
39
 
    void set_target(Vector<int>target);
 
52
    //! Point to another position on the miniature map graphic.
 
53
    /**
 
54
     * @note This is used to point to a hidden map Reward after a Quest has
 
55
     * been completed.
 
56
     */
 
57
    void set_target(Vector<int>target){ d_target = target;}
40
58
 
41
59
 private:
 
60
    //! The Quest to depict on the miniature map graphic.
42
61
    Quest *quest;
 
62
 
 
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);
 
65
 
 
66
    //! Draw a line to a boxed target.
44
67
    void draw_target(Vector<int> start, Vector<int> target);
 
68
 
 
69
    //! Draw a box around a target.
45
70
    void draw_target();
46
71
    
 
72
    //! The new position to point to on the miniature map graphic.
47
73
    Vector<int> d_target;
48
 
    // hook from base class
 
74
 
 
75
    
 
76
    //! Draw the Quest onto the miniature map graphic.
 
77
    /**
 
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.
 
81
     */
49
82
    virtual void after_draw();
50
83
};
51
84