~ubuntu-branches/ubuntu/maverick/lordsawar/maverick

« back to all changes in this revision

Viewing changes to src/itemmap.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2010-04-10 09:29:33 UTC
  • mfrom: (1.1.9 upstream) (5.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100410092933-23uq4dxig30kmtcw
Tags: 0.1.8-1
* New upstream release.
* Add misc:Depends for -data package.
* Bump Standards Version to 3.8.4. (No changes needed).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//  Copyright (C) 2010 Ben Asselstine
 
2
//
 
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.
 
7
//
 
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.
 
12
//
 
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 
 
16
//  02110-1301, USA.
 
17
 
 
18
#ifndef ITEMMAP_H
 
19
#define ITEMMAP_H
 
20
 
 
21
#include <sigc++/signal.h>
 
22
 
 
23
#include "overviewmap.h"
 
24
#include "input-events.h"
 
25
 
 
26
class Stack;
 
27
class MapBackpack;
 
28
 
 
29
//! Draw a miniature map graphic with an indication of where items are.
 
30
/** 
 
31
 * This draws stacks that have heroes that have items, as well as bags that
 
32
 * are dropped onto the map.
 
33
 */
 
34
class ItemMap : public OverviewMap
 
35
{
 
36
 public:
 
37
     //! Default constructor.  Make a new ItemMap.
 
38
     /**
 
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.
 
43
      */
 
44
     ItemMap(std::list<Stack*> item_laden_stacks, std::list<MapBackpack*> bags);
 
45
 
 
46
    //! Emitted when the icons are finished being drawn on the map surface.
 
47
    /**
 
48
     * Classes that use ItemMap must catch this signal to display the map.
 
49
     */
 
50
    sigc::signal<void, Glib::RefPtr<Gdk::Pixmap> > map_changed;
 
51
    
 
52
 private:
 
53
    //! The bags to draw bag icons for.
 
54
    std::list<MapBackpack *>bags;
 
55
 
 
56
    //! The item laden stacks to draw hero icons for.
 
57
    std::list<Stack *>stacks;
 
58
    
 
59
    //! Draw the bag icons on the miniature map graphic.
 
60
    void draw_bags();
 
61
 
 
62
    //! Draw a bag icon at the given tile on the miniature map graphic.
 
63
    void draw_bag(Vector<int> pos);
 
64
 
 
65
    //! Draw the hero icons on the miniature map graphic.
 
66
    void draw_heroes();
 
67
 
 
68
    //! Draw the hero and bag icons onto the miniature map graphic.
 
69
    /**
 
70
     * This draws the shields for each city as well as icons to indicate
 
71
     * where the items are.
 
72
     *
 
73
     * This method is automatically called by the ItemMap::draw method.
 
74
     */
 
75
    virtual void after_draw();
 
76
};
 
77
 
 
78
#endif