~ubuntu-branches/ubuntu/saucy/lordsawar/saucy

« back to all changes in this revision

Viewing changes to src/shieldstyle.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese, Barry deFreese
  • Date: 2008-12-20 13:52:12 UTC
  • mfrom: (1.1.6 upstream) (5.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20081220135212-noeb2w3y98ebo7o9
Tags: 0.1.4-1
[ Barry deFreese ]
* New upstream release.
* Move 0.0.8-2.1 changelog entry to correct point in changelog.
* Make lordsawar-data suggest lordsawar.
* Update my e-mail address.
* Add build-depends on intltool, uuid-dev, and libboost-dev.
* Don't install locales since there are no translations currently.
* Add simple man page for new lordsawar-pbm binary.
* Drop gcc4.3 patches as they have been fixed upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
#include <sigc++/trackable.h>
24
24
#include <sigc++/signal.h>
25
25
 
26
 
#include "defs.h"
27
26
 
28
27
class Player;
29
28
class XML_Helper;
33
32
/**
34
33
 * This class is the atom of every shield. It contains all data related to
35
34
 * a single ShieldStyle type of a Shield.  ShieldStyles come in three sizes: 
36
 
 * small, medium and large (ShieldStyle::ShieldStyleType).
 
35
 * small, medium and large (ShieldStyle::Type).
37
36
 *
38
37
 * Every ShieldStyle object has an image and a mask.  The mask identifies the
39
38
 * portion of the ShieldStyle to shade in the Player's colour (Player::d_color).
44
43
{
45
44
    public:
46
45
 
 
46
        //! The xml tag of this object in a shieldset configuration file.
 
47
        static std::string d_tag; 
 
48
 
47
49
        //! The size of the shield.
48
 
        enum ShieldStyleType {
 
50
        enum Type {
49
51
          //! Small shields are shown on the OverviewMap object.
50
52
          SMALL = 0, 
51
53
          //! Medium shields are shown in the top right of the GameWindow.
53
55
          //! Large shields are shown in the DiplomacyDialog and FightWindow.
54
56
          LARGE = 2
55
57
        };
 
58
        static std::string shieldStyleTypeToString(const ShieldStyle::Type type);
 
59
        static ShieldStyle::Type shieldStyleTypeFromString(const std::string str);
56
60
 
57
61
        //! Loading constructor.
58
62
        /**
92
96
        //! Returns the basename of the picture's filename.
93
97
        std::string getImageName() const {return d_image;}
94
98
 
95
 
        bool instantiatePixmap(Shieldset *sh);
96
99
    protected:
97
100
 
98
101
        //! The size of the shield. (small, medium, or large)
99
102
        /**
100
103
         * Equates to the shieldset.shield.d_type XML entities in the shieldset
101
104
         * configuration file.
102
 
         * Equates to the ShieldStyle::ShieldStyleType enumeration.
 
105
         * Equates to the ShieldStyle::Type enumeration.
103
106
         */
104
107
        Uint32 d_type;
105
108