Dragonfly 4.20
A text-based game engine
|
Public Member Functions | |
Box (Vector init_corner, float init_horizontal, float init_vertical) | |
Box () | |
void | setCorner (Vector new_corner) |
Vector | getCorner () const |
void | setHorizontal (float new_horizontal) |
float | getHorizontal () const |
void | setVertical (float new_vertical) |
float | getVertical () const |
std::string | toString () const |
bool | operator== (const Box &other) const |
bool | operator!= (const Box &other) const |
void | draw () |
int | serialize (std::stringstream *p_ss) const |
int | deserialize (std::stringstream *p_ss) |
Private Attributes | |
Vector | m_corner |
float | m_horizontal |
float | m_vertical |
df::Box::Box | ( | Vector | init_corner, |
float | init_horizontal, | ||
float | init_vertical | ||
) |
Create box with upper-left corner, horiz and vert sizes.
df::Box::Box | ( | ) |
Create box with (0,0) for corner, and 0 for horiz and vert.
int df::Box::deserialize | ( | std::stringstream * | p_ss | ) |
Deserialize attributes from stream.
Return 0 if ok, else -1.
void df::Box::draw | ( | ) |
Draw box outline in pixels.
Vector df::Box::getCorner | ( | ) | const |
Get upper left corner of box.
float df::Box::getHorizontal | ( | ) | const |
Get horizontal size of box.
float df::Box::getVertical | ( | ) | const |
Get vertical size of box.
bool df::Box::operator== | ( | const Box & | other | ) | const |
Compare two boxes.
int df::Box::serialize | ( | std::stringstream * | p_ss | ) | const |
Serialize attributes to stream.
Return 0 if ok, else -1.
void df::Box::setCorner | ( | Vector | new_corner | ) |
Set upper left corner of box.
void df::Box::setHorizontal | ( | float | new_horizontal | ) |
Set horizontal size of box.
void df::Box::setVertical | ( | float | new_vertical | ) |
Set vertical size of box.
std::string df::Box::toString | ( | ) | const |
Return attributes as string.
|
private |
Upper left corner of box.
|
private |
Horizontal dimension.
|
private |
Vertical dimension.