/** * Calls cleanup on attached states, do not call directly. */ public void cleanup(){ AppState[] array = getStates(); for (AppState state : array){ state.cleanup(); } } }
/** * Calls render for all attached and initialized states, do not call directly. */ public void postRender(){ AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.postRender(); } } }
AppState[] array = getStates(); for (AppState state : array) { if (stateClass.isAssignableFrom(state.getClass())){
/** * Calls render for all attached and initialized states, do not call directly. * @param rm The RenderManager */ public void render(RenderManager rm){ AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.render(rm); } } }
/** * Calls update for attached states, do not call directly. * @param tpf Time per frame. */ public void update(float tpf){ // Cleanup any states pending terminatePending(); // Initialize any states pending initializePending(); // Update enabled states AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.update(tpf); } } }
/** * Calls cleanup on attached states, do not call directly. */ public void cleanup(){ AppState[] array = getStates(); for (AppState state : array){ state.cleanup(); } } }
/** * Calls cleanup on attached states, do not call directly. */ public void cleanup(){ AppState[] array = getStates(); for (AppState state : array){ state.cleanup(); } } }
/** * Returns the first state that is an instance of subclass of the specified class. * @param <T> * @param stateClass * @return First attached state that is an instance of stateClass */ public <T extends AppState> T getState(Class<T> stateClass){ synchronized (states){ AppState[] array = getStates(); for (AppState state : array) { if (stateClass.isAssignableFrom(state.getClass())){ return (T) state; } } // This may be more trouble than its worth but I think // it's necessary for proper decoupling of states and provides // similar behavior to before where a state could be looked // up even if it wasn't initialized. -pspeed array = getInitializing(); for (AppState state : array) { if (stateClass.isAssignableFrom(state.getClass())){ return (T) state; } } } return null; }
/** * Calls render for all attached and initialized states, do not call directly. * @param rm The RenderManager */ public void render(RenderManager rm){ AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.render(rm); } } }
/** * Calls render for all attached and initialized states, do not call directly. */ public void postRender(){ AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.postRender(); } } }
/** * Returns the first state that is an instance of subclass of the specified class. * @param <T> * @param stateClass * @return First attached state that is an instance of stateClass */ public <T extends AppState> T getState(Class<T> stateClass){ synchronized (states){ AppState[] array = getStates(); for (AppState state : array) { if (stateClass.isAssignableFrom(state.getClass())){ return (T) state; } } // This may be more trouble than its worth but I think // it's necessary for proper decoupling of states and provides // similar behavior to before where a state could be looked // up even if it wasn't initialized. -pspeed array = getInitializing(); for (AppState state : array) { if (stateClass.isAssignableFrom(state.getClass())){ return (T) state; } } } return null; }
/** * Calls render for all attached and initialized states, do not call directly. * @param rm The RenderManager */ public void render(RenderManager rm){ AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.render(rm); } } }
/** * Calls render for all attached and initialized states, do not call directly. */ public void postRender(){ AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.postRender(); } } }
/** * Calls update for attached states, do not call directly. * @param tpf Time per frame. */ public void update(float tpf){ // Cleanup any states pending terminatePending(); // Initialize any states pending initializePending(); // Update enabled states AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.update(tpf); } } }
/** * Calls update for attached states, do not call directly. * @param tpf Time per frame. */ public void update(float tpf){ // Cleanup any states pending terminatePending(); // Initialize any states pending initializePending(); // Update enabled states AppState[] array = getStates(); for (AppState state : array){ if (state.isEnabled()) { state.update(tpf); } } }