Added an extra assert macro to GuiComponent.

This commit is contained in:
Leon Styhre 2022-01-29 18:12:30 +01:00
parent 4b1138ebc7
commit 336ff3ea7c

View file

@ -127,7 +127,11 @@ public:
void sortChildren(); void sortChildren();
const unsigned int getChildCount() const { return static_cast<int>(mChildren.size()); } const unsigned int getChildCount() const { return static_cast<int>(mChildren.size()); }
const int getChildIndex() const; const int getChildIndex() const;
GuiComponent* getChild(unsigned int i) const { return mChildren.at(i); } GuiComponent* getChild(unsigned int i) const
{
assert(mChildren.size() >= i);
return mChildren.at(i);
}
// Animation will be automatically deleted when it completes or is stopped. // Animation will be automatically deleted when it completes or is stopped.
const bool isAnimationPlaying(unsigned char slot) const const bool isAnimationPlaying(unsigned char slot) const