Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

getEntityModifierCount and getUpdateHandlerCount #112

Merged
merged 1 commit into from

2 participants

@player-03

Two simple, occasionally useful functions that won't get in the way of anything else.

@nicolasgramlich nicolasgramlich merged commit e6df5e8 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 20, 2012
This page is out of date. Refresh to see the latest.
View
16 src/org/andengine/entity/Entity.java
@@ -834,6 +834,14 @@ public boolean unregisterUpdateHandlers(final IUpdateHandlerMatcher pUpdateHandl
}
return this.mUpdateHandlers.removeAll(pUpdateHandlerMatcher);
}
+
+ @Override
+ public int getUpdateHandlerCount() {
+ if(this.mUpdateHandlers == null) {
+ return 0;
+ }
+ return this.mUpdateHandlers.size();
+ }
@Override
public void clearUpdateHandlers() {
@@ -866,6 +874,14 @@ public boolean unregisterEntityModifiers(final IEntityModifierMatcher pEntityMod
}
return this.mEntityModifiers.removeAll(pEntityModifierMatcher);
}
+
+ @Override
+ public int getEntityModifierCount() {
+ if(this.mEntityModifiers == null) {
+ return 0;
+ }
+ return this.mEntityModifiers.size();
+ }
@Override
public void clearEntityModifiers() {
View
2  src/org/andengine/entity/IEntity.java
@@ -295,11 +295,13 @@
public void registerUpdateHandler(final IUpdateHandler pUpdateHandler);
public boolean unregisterUpdateHandler(final IUpdateHandler pUpdateHandler);
public boolean unregisterUpdateHandlers(final IUpdateHandlerMatcher pUpdateHandlerMatcher);
+ public int getUpdateHandlerCount();
public void clearUpdateHandlers();
public void registerEntityModifier(final IEntityModifier pEntityModifier);
public boolean unregisterEntityModifier(final IEntityModifier pEntityModifier);
public boolean unregisterEntityModifiers(final IEntityModifierMatcher pEntityModifierMatcher);
+ public int getEntityModifierCount();
public void clearEntityModifiers();
public boolean isCullingEnabled();
View
10 src/org/andengine/entity/scene/menu/item/decorator/BaseMenuItemDecorator.java
@@ -414,6 +414,11 @@ public boolean unregisterEntityModifiers(final IEntityModifierMatcher pEntityMod
}
@Override
+ public int getEntityModifierCount() {
+ return this.mMenuItem.getEntityModifierCount();
+ }
+
+ @Override
public void clearEntityModifiers() {
this.mMenuItem.clearEntityModifiers();
}
@@ -794,6 +799,11 @@ public boolean unregisterUpdateHandler(final IUpdateHandler pUpdateHandler) {
}
@Override
+ public int getUpdateHandlerCount() {
+ return this.mMenuItem.getUpdateHandlerCount();
+ }
+
+ @Override
public void clearUpdateHandlers() {
this.mMenuItem.clearUpdateHandlers();
}
Something went wrong with that request. Please try again.