Dragonfly 4.19
A text-based game engine
Public Member Functions | Private Attributes | Friends | List of all members
df::ObjectList Class Reference

Public Member Functions

 ObjectList (const ObjectList &other)
 
ObjectListoperator= (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)
 
ObjectListoperator+= (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
 

Constructor & Destructor Documentation

◆ ObjectList()

df::ObjectList::ObjectList ( const ObjectList other)

Copy contructor (does deep copy).

Member Function Documentation

◆ clear()

void df::ObjectList::clear ( )

Clear list (setting count to 0).

◆ getCount()

int df::ObjectList::getCount ( ) const

Return count of number of objects in list.

◆ insert()

int df::ObjectList::insert ( Object p_o)

Insert object pointer in list.

Return 0 if ok, else -1.

◆ isEmpty()

bool df::ObjectList::isEmpty ( ) const

Return true if list is empty, else false.

◆ isFull()

bool df::ObjectList::isFull ( ) const

Return true if list is full, else false.

◆ operator!=()

bool df::ObjectList::operator!= ( const ObjectList other) const

Compare two lists.

◆ operator+()

ObjectList df::ObjectList::operator+ ( ObjectList  )

Add two lists, second appended to first.

◆ operator+=()

ObjectList & df::ObjectList::operator+= ( const ObjectList other)

Add other ObjectList to this one.

◆ operator=()

ObjectList & df::ObjectList::operator= ( const ObjectList rhs)

Assignment operator (does deep copy).

◆ operator==()

bool df::ObjectList::operator== ( const ObjectList other) const

Compare two lists.

◆ operator[]()

Object *& df::ObjectList::operator[] ( int  index)

Index into list.

◆ remove()

int df::ObjectList::remove ( Object p_o)

Remove object pointer from list, Return 0 if found, else -1.

Friends And Related Function Documentation

◆ ObjectListIterator

friend class ObjectListIterator
friend

Iterators can access.

Member Data Documentation

◆ m_count

int df::ObjectList::m_count
private

Count of objects in list.

◆ m_max_count

int df::ObjectList::m_max_count
private

Maximum objects in list (variable).

◆ p_item

Object** df::ObjectList::p_item
private

Array of pointers to objects.