add clearMenuItems() method to MenuScene; make mMenuItems protected #101

Merged
merged 1 commit into from May 14, 2012

Conversation

Projects
None yet
2 participants
@nazgee
Contributor

nazgee commented May 7, 2012

mMenuItems field can now be cleared. It is also protected, not private any more. This makes reusing MenuScenes easier and more powerful.

@nicolasgramlich

View changes

src/org/andengine/entity/scene/menu/MenuScene.java
@@ -83,6 +84,15 @@ public void addMenuItem(final IMenuItem pMenuItem) {
this.registerTouchArea(pMenuItem);
}
+ public void clearMenuItems() {
+ for (Iterator<IMenuItem> iterator = mMenuItems.iterator(); iterator.hasNext();) {

This comment has been minimized.

Show comment Hide comment
@nicolasgramlich

nicolasgramlich May 7, 2012

Owner

Loops using iterators are not accepted! =)

Preferred way of looping is from "size - 1" down to 0.

@nicolasgramlich

nicolasgramlich May 7, 2012

Owner

Loops using iterators are not accepted! =)

Preferred way of looping is from "size - 1" down to 0.

This comment has been minimized.

Show comment Hide comment
@nazgee

nazgee May 7, 2012

Contributor

done

@nazgee

nazgee May 7, 2012

Contributor

done

Menu Scene is now a little bit more liberal about mMenuItems
mMenuItems can now be cleared. It is also protected, not private.
@nazgee

This comment has been minimized.

Show comment Hide comment
@nazgee

nazgee May 10, 2012

Contributor

gentle ping on this one :)

Contributor

nazgee commented May 10, 2012

gentle ping on this one :)

nicolasgramlich added a commit that referenced this pull request May 14, 2012

Merge pull request #101 from nazgee/for-nicolas-mMenuItems
Add clearMenuItems() method to MenuScene. Made mMenuItems protected.

@nicolasgramlich nicolasgramlich merged commit b631d50 into nicolasgramlich:GLES2 May 14, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment