Dragonfly 4.20
A text-based game engine
|
Public Member Functions | |
Vector | nextNode () const |
Vector | previousNode () const |
void | setPath (std::vector< Vector > new_path) |
std::vector< Vector > | getPath () const |
bool | endOfPath () const |
Vector | getEnd () const |
int | setIndex (int new_index) |
int | getIndex () const |
int | draw (Color color) const |
Path | operator++ (int) |
int | serialize (std::stringstream *p_ss) const |
int | deserialize (std::stringstream *p_ss) |
bool | operator== (const Path &p) |
bool | operator!= (const Path &p) |
std::string | toString () const |
Private Attributes | |
std::vector< Vector > | m_path |
int | m_index |
int df::Path::draw | ( | Color | color | ) | const |
Draw remaining path in indicated color.
Return 0 if ok, negative if not.
bool df::Path::endOfPath | ( | ) | const |
Return true when at end of path.
Vector df::Path::getEnd | ( | ) | const |
Return last node of path.
int df::Path::getIndex | ( | ) | const |
Return index of path.
std::vector< Vector > df::Path::getPath | ( | ) | const |
Return path.
Vector df::Path::nextNode | ( | ) | const |
Return next node in path.
Return (-1,-1) if none.
Path df::Path::operator++ | ( | int | ) |
Increment path target node.
If at last node, index stays at end.
bool df::Path::operator== | ( | const Path & | p | ) |
Compare two Paths.
Vector df::Path::previousNode | ( | ) | const |
Return previous node in path.
Return (-1,-1) if none.
int df::Path::setIndex | ( | int | new_index | ) |
Set index of path.
Return 0 if ok, else -1;
void df::Path::setPath | ( | std::vector< Vector > | new_path | ) |
Set path.
std::string df::Path::toString | ( | ) | const |
Return attributes as string.
|
private |
Index of next target node.
|
private |
Nodes in path.