Hi!
I've to set the maximum no. of elements in a list. i.e My list should contain only 5 elements. How to do this?
Set no of Elements in a list.
If you refer to the irr::core::list than what you could do is check if the maximum is not reached yet, if not add another item.
Code: Select all
int max = 5; // or you could use define, up to you to decide.
.....
if(mylist.getSize()!=max)
mylist.push_back(ITEM);
Working on game: Marrbles (Currently stopped).
All the same
Code: Select all
getItemCount()
addItem(...)
Never take advice from someone who likes to give advice, so take my advice and don't take it.