5#ifndef __VIEW_OBJECT_H__
6#define __VIEW_OBJECT_H__
64 virtual int draw()
override;
114 virtual std::string
serialize(std::string attr=
"")
override;
Definition: ViewObject.h:45
virtual int draw() override
Draw view string (and value).
virtual int setPosition(Vector new_pos) override
Set position of ViewObject, with setting "location" to UNDEFINED.
virtual int eventHandler(const Event *p_e) override
Handle "view" event if tag matches view_string (others ignored).
bool m_draw_value
True if should draw value.
Definition: ViewObject.h:50
bool getDrawValue() const
Get draw value (true if draw value with display string).
void setValue(int new_value)
Set view value.
int getValue() const
Get view value.
std::string getViewString() const
Get view display string.
ViewObject()
Construct ViewObject.
void setViewString(std::string new_view_string)
Set view display string.
void setBorder(bool new_border)
Set view border (true = display border).
std::string m_view_string
Label for value (e.g., "Points").
Definition: ViewObject.h:48
bool m_vmodified[VATTR_COUNT]
Mod. attrib. since serialize().
Definition: ViewObject.h:54
int m_value
Value displayed (e.g., points).
Definition: ViewObject.h:49
virtual std::string serialize(std::string attr="") override
Serialize ViewObject attributes to single string.
bool getBorder() const
Get view border (true = display border).
bool m_border
True if border around display.
Definition: ViewObject.h:51
void setColor(Color new_color)
Set view color.
void setLocation(ViewObjectLocation new_location)
Set general location of ViewObject on screen.
virtual bool isModified(enum ViewObjectAttribute attribute) const
Return true if attribute modified since last serialize.
ViewObjectLocation m_location
Location of ViewObject.
Definition: ViewObject.h:53
Color getColor() const
Get view color.
virtual bool isModified() const override
Return true if any attribute modified since last serialize.
virtual int deserialize(std::string s) override
Deserialize string to become attributes.
ViewObjectLocation getLocation() const
Get general location of ViewObject on screen.
Color m_color
Color for text (and border).
Definition: ViewObject.h:52
void setDrawValue(bool new_draw_value=true)
Set true to draw value with display string.
An animation for a sprite.
Definition: Animation.h:15
ViewObjectAttribute
Categories of view object attributes that indicate modification.
Definition: ViewObject.h:22
const int VATTR_COUNT
Count of number of view object modified attribute categories.
Definition: ViewObject.h:19
Color
Colors Dragonfly recognizes.
Definition: Color.h:11
ViewObjectLocation
General location of ViewObject on screen.
Definition: ViewObject.h:32