Dragonfly  4.3
A text-based game engine
Frame.h
1 ///
2 /// A sprite frame
3 ///
4 
5 #ifndef __FRAME_H__
6 #define __FRAME_H__
7 
8 #include <string>
9 
10 namespace df {
11 
12 class Frame {
13 
14  private:
15  int m_width; ///< Width of frame
16  int m_height; ///< Height of frame
17  std::string m_frame_str; ///< All frame characters stored as string.
18 
19  public:
20  /// Create empty frame.
21  Frame();
22 
23  /// Create frame of indicated width and height with string.
24  Frame(int new_width, int new_height, std::string frame_str);
25 
26  /// Set width of frame.
27  void setWidth(int new_width);
28 
29  /// Get width of frame.
30  int getWidth() const;
31 
32  /// Set height of frame.
33  void setHeight(int new_height);
34 
35  /// Get height of frame.
36  int getHeight() const;
37 
38  /// Set frame characters (stored as string).
39  void setString(std::string new_frame_str);
40 
41  /// Get frame characters (stored as string).
42  std::string getString() const;
43 };
44 
45 } // end of namespace df
46 #endif //__FRAME_H__
void setWidth(int new_width)
Set width of frame.
void setHeight(int new_height)
Set height of frame.
int m_width
Width of frame.
Definition: Frame.h:15
A 2-d bounding box.
Definition: Box.h:10
void setString(std::string new_frame_str)
Set frame characters (stored as string).
int getWidth() const
Get width of frame.
int getHeight() const
Get height of frame.
Definition: Frame.h:12
Frame()
Create empty frame.
int m_height
Height of frame.
Definition: Frame.h:16
std::string m_frame_str
All frame characters stored as string.
Definition: Frame.h:17
std::string getString() const
Get frame characters (stored as string).