Dragonfly 4.20
A text-based game engine
|
Public Member Functions | |
ObjectList (const ObjectList &other) | |
ObjectList & | operator= (const ObjectList &rhs) |
int | insert (Object *p_o) |
int | remove (Object *p_o) |
void | clear () |
int | getCount () const |
bool | isEmpty () const |
bool | isFull () const |
ObjectList | operator+ (ObjectList) |
ObjectList & | operator+= (const ObjectList &other) |
bool | operator== (const ObjectList &other) const |
bool | operator!= (const ObjectList &other) const |
Object *& | operator[] (int index) |
Private Attributes | |
int | m_count |
int | m_max_count |
Object ** | p_item |
Friends | |
class | ObjectListIterator |
df::ObjectList::ObjectList | ( | const ObjectList & | other | ) |
Copy contructor (does deep copy).
void df::ObjectList::clear | ( | ) |
Clear list (setting count to 0).
int df::ObjectList::getCount | ( | ) | const |
Return count of number of objects in list.
int df::ObjectList::insert | ( | Object * | p_o | ) |
Insert object pointer in list.
Return 0 if ok, else -1.
bool df::ObjectList::isEmpty | ( | ) | const |
Return true if list is empty, else false.
bool df::ObjectList::isFull | ( | ) | const |
Return true if list is full, else false.
bool df::ObjectList::operator!= | ( | const ObjectList & | other | ) | const |
Compare two lists.
ObjectList df::ObjectList::operator+ | ( | ObjectList | ) |
Add two lists, second appended to first.
ObjectList & df::ObjectList::operator+= | ( | const ObjectList & | other | ) |
Add other ObjectList to this one.
ObjectList & df::ObjectList::operator= | ( | const ObjectList & | rhs | ) |
Assignment operator (does deep copy).
bool df::ObjectList::operator== | ( | const ObjectList & | other | ) | const |
Compare two lists.
Object *& df::ObjectList::operator[] | ( | int | index | ) |
Index into list.
int df::ObjectList::remove | ( | Object * | p_o | ) |
Remove object pointer from list, Return 0 if found, else -1.
|
friend |
Iterators can access.
|
private |
Count of objects in list.
|
private |
Maximum objects in list (variable).
|
private |
Array of pointers to objects.