5#ifndef __VIEW_OBJECT_H__ 
    6#define __VIEW_OBJECT_H__ 
   20  VALUE      = 1 << (ObjectAttributeMax + 0),  
 
   21  APPEARANCE = 1 << (ObjectAttributeMax + 1),  
 
   23const int ViewObjectAttributeMax = ObjectAttributeMax + 2;
 
   57  virtual int draw() 
override;
 
  107  virtual int serialize(std::stringstream *p_ss, 
unsigned int attr=0) 
override;
 
  113  virtual int deserialize(std::stringstream *p_ss, 
unsigned int *p_a=NULL) 
override;
 
Definition: ViewObject.h:39
 
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:44
 
bool operator==(const ViewObject &vo)
Compare two ViewObjects.
 
virtual void setDrawValue(bool new_draw_value=true)
Set true to draw value with display string.
 
bool getDrawValue() const
Get draw value (true if draw value with display string).
 
virtual void setLocation(ViewObjectLocation new_location)
Set general location of ViewObject on screen.
 
int getValue() const
Get view value.
 
std::string getViewString() const
Get view display string.
 
virtual void setViewString(std::string new_view_string)
Set view display string.
 
virtual int deserialize(std::stringstream *p_ss, unsigned int *p_a=NULL) override
Deserialize stream to attributes and apply.
 
ViewObject()
Construct ViewObject.
 
virtual 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:42
 
int m_value
Value displayed (e.g., points).
Definition: ViewObject.h:43
 
virtual int serialize(std::stringstream *p_ss, unsigned int attr=0) override
Serialize modified attributes to stream.
 
std::string toString() const
Return base attributes as string.
 
bool getBorder() const
Get view border (true = display border).
 
bool m_border
True if border around display.
Definition: ViewObject.h:45
 
ViewObjectLocation m_location
Location of ViewObject.
Definition: ViewObject.h:47
 
Color getColor() const
Get view color.
 
ViewObjectLocation getLocation() const
Get general location of ViewObject on screen.
 
virtual void setValue(int new_value)
Set view value.
 
Color m_color
Color for text (and border).
Definition: ViewObject.h:46
 
virtual void setColor(Color new_color)
Set view color.
 
An animation for a sprite.
Definition: Animation.h:15
 
Color
Colors Dragonfly recognizes.
Definition: Color.h:11
 
ViewObjectAttribute
Categories of ViewObject attributes that indicate modification.
Definition: ViewObject.h:19
 
ViewObjectLocation
General location on screen.
Definition: ViewObject.h:26