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

« back to all changes in this revision

Viewing changes to src/shieldstyle.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:
21
21
#include <gtkmm.h>
22
22
#include <string>
23
23
#include <sigc++/trackable.h>
24
 
#include <sigc++/signal.h>
25
24
#include "PixMask.h"
26
25
 
27
26
 
56
55
          //! Large shields are shown in the DiplomacyDialog and FightWindow.
57
56
          LARGE = 2
58
57
        };
59
 
        static std::string shieldStyleTypeToString(const ShieldStyle::Type type);
60
 
        static ShieldStyle::Type shieldStyleTypeFromString(const std::string str);
61
58
 
62
59
        //! Loading constructor.
63
60
        /**
68
65
         *                shield object from.
69
66
         */
70
67
        ShieldStyle(XML_Helper* helper);
 
68
 
 
69
 
 
70
        //! Default constructor.
 
71
        ShieldStyle(ShieldStyle::Type type);
71
72
        
72
73
        //! Destructor.
73
74
        virtual ~ShieldStyle();
74
75
 
75
 
        // Set functions:
 
76
        
 
77
        // Get Methods
 
78
        
 
79
        //! Get the size of this shield.
 
80
        guint32 getType() const {return d_type;}
 
81
 
 
82
        //! Get the image of the shield.
 
83
        PixMask* getImage() const {return d_image;}
 
84
 
 
85
        //! Returns the mask of the shield.
 
86
        PixMask* getMask() const {return d_mask;}
 
87
 
 
88
        //! Returns the basename of the picture's filename.
 
89
        std::string getImageName() const {return d_image_name;}
 
90
 
 
91
 
 
92
        // Set Methods
76
93
        
77
94
        //! Set the basic image of the shield.
78
95
        void setImage(PixMask* image) {d_image = image;};
82
99
 
83
100
        //! Set the basename of the shield picture's filename.
84
101
        void setImageName(std::string name) {d_image_name = name;}
85
 
        
86
 
        // Get functions
87
 
        
88
 
        //! Get the size of this shield.
89
 
        guint32 getType() const {return d_type;}
90
 
 
91
 
        //! Get the image of the shield.
92
 
        PixMask* getImage() {return d_image;}
93
 
 
94
 
        //! Returns the mask of the shield.
95
 
        PixMask* getMask() {return d_mask;}
96
 
 
97
 
        //! Returns the basename of the picture's filename.
98
 
        std::string getImageName() const {return d_image_name;}
99
 
 
 
102
 
 
103
 
 
104
        // Methods that operate on class data and modify the class.
 
105
 
 
106
        //! Load the images for this shieldstyle from the given file.
 
107
        void instantiateImages(std::string filename, Shieldset *s);
 
108
 
 
109
        //! Destroy the images associated with this shieldstyle.
 
110
        void uninstantiateImages();
 
111
 
 
112
 
 
113
        // Methods that operate on class data but do not modify the class.
 
114
        
 
115
        //! Save the shieldstyle to an opened shieldset configuration file.
 
116
        bool save(XML_Helper *helper) const;
 
117
 
 
118
 
 
119
        // Static Methods
 
120
        
 
121
        //! Convert a ShieldStyle::Type enumerated value to a string.
 
122
        static std::string shieldStyleTypeToString(const ShieldStyle::Type type);
 
123
 
 
124
        //! Convert a ShieldStyle::Type string to an enumerated value.
 
125
        static ShieldStyle::Type shieldStyleTypeFromString(const std::string str);
100
126
    protected:
101
127
 
102
128
        //! The size of the shield. (small, medium, or large)