protected boolean delegate (float delta) { if (time < duration) { time += delta; if (time < duration) return false; delta = time - duration; } if (action == null) return true; return action.act(delta); }
protected boolean delegate (float delta) { if (time < duration) { time += delta; if (time < duration) return false; delta = time - duration; } if (action == null) return true; return action.act(delta); }
protected boolean delegate (float delta) { if (action == null) return true; return action.act(delta * scale); }
protected boolean delegate (float delta) { if (action == null) return true; return action.act(delta * scale); }
protected boolean delegate (float delta) { if (executedCount == repeatCount) return true; if (action.act(delta)) { if (finished) return true; if (repeatCount > 0) executedCount++; if (executedCount == repeatCount) return true; if (action != null) action.restart(); } return false; }
protected boolean delegate (float delta) { if (executedCount == repeatCount) return true; if (action.act(delta)) { if (finished) return true; if (repeatCount > 0) executedCount++; if (executedCount == repeatCount) return true; if (action != null) action.restart(); } return false; }
public boolean act (float delta) { if (index >= actions.size) return true; Pool pool = getPool(); setPool(null); // Ensure this action can't be returned to the pool while executings. try { if (actions.get(index).act(delta)) { if (actor == null) return true; // This action was removed. index++; if (index >= actions.size) return true; } return false; } finally { setPool(pool); } }
public boolean act (float delta) { if (index >= actions.size) return true; Pool pool = getPool(); setPool(null); // Ensure this action can't be returned to the pool while executings. try { if (actions.get(index).act(delta)) { if (actor == null) return true; // This action was removed. index++; if (index >= actions.size) return true; } return false; } finally { setPool(pool); } }
protected boolean delegate (float delta) { Array<Action> currentActions = target.getActions(); if (currentActions.size == 1) waitForActions.clear(); for (int i = waitForActions.size - 1; i >= 0; i--) { Action action = waitForActions.get(i); int index = currentActions.indexOf(action, true); if (index == -1) waitForActions.removeIndex(i); } if (waitForActions.size > 0) return false; return action.act(delta); } }
/** Updates the actor based on time. Typically this is called each frame by {@link Stage#act(float)}. * <p> * The default implementation calls {@link Action#act(float)} on each action and removes actions that are complete. * @param delta Time in seconds since the last frame. */ public void act (float delta) { Array<Action> actions = this.actions; if (actions.size == 0) return; if (stage != null && stage.getActionsRequestRendering()) Gdx.graphics.requestRendering(); try { for (int i = 0; i < actions.size; i++) { Action action = actions.get(i); if (action.act(delta) && i < actions.size) { Action current = actions.get(i); int actionIndex = current == action ? i : actions.indexOf(action, true); if (actionIndex != -1) { actions.removeIndex(actionIndex); action.setActor(null); i--; } } } } catch (RuntimeException ex) { String context = toString(); throw new RuntimeException("Actor: " + context.substring(0, Math.min(context.length(), 128)), ex); } }
/** Updates the actor based on time. Typically this is called each frame by {@link Stage#act(float)}. * <p> * The default implementation calls {@link Action#act(float)} on each action and removes actions that are complete. * @param delta Time in seconds since the last frame. */ public void act (float delta) { Array<Action> actions = this.actions; if (actions.size == 0) return; if (stage != null && stage.getActionsRequestRendering()) Gdx.graphics.requestRendering(); try { for (int i = 0; i < actions.size; i++) { Action action = actions.get(i); if (action.act(delta) && i < actions.size) { Action current = actions.get(i); int actionIndex = current == action ? i : actions.indexOf(action, true); if (actionIndex != -1) { actions.removeIndex(actionIndex); action.setActor(null); i--; } } } } catch (RuntimeException ex) { String context = toString(); throw new RuntimeException("Actor: " + context.substring(0, Math.min(context.length(), 128)), ex); } }
protected boolean delegate (float delta) { Array<Action> currentActions = target.getActions(); if (currentActions.size == 1) waitForActions.clear(); for (int i = waitForActions.size - 1; i >= 0; i--) { Action action = waitForActions.get(i); int index = currentActions.indexOf(action, true); if (index == -1) waitForActions.removeIndex(i); } if (waitForActions.size > 0) return false; return action.act(delta); } }
public boolean act (float delta) { if (complete) return true; complete = true; Pool pool = getPool(); setPool(null); // Ensure this action can't be returned to the pool while executing. try { Array<Action> actions = this.actions; for (int i = 0, n = actions.size; i < n && actor != null; i++) { Action currentAction = actions.get(i); if (currentAction.getActor() != null && !currentAction.act(delta)) complete = false; if (actor == null) return true; // This action was removed. } return complete; } finally { setPool(pool); } }
public boolean act (float delta) { if (complete) return true; complete = true; Pool pool = getPool(); setPool(null); // Ensure this action can't be returned to the pool while executing. try { Array<Action> actions = this.actions; for (int i = 0, n = actions.size; i < n && actor != null; i++) { Action currentAction = actions.get(i); if (currentAction.getActor() != null && !currentAction.act(delta)) complete = false; if (actor == null) return true; // This action was removed. } return complete; } finally { setPool(pool); } }
protected boolean delegate (float delta) { if (time < duration) { time += delta; if (time < duration) return false; delta = time - duration; } if (action == null) return true; return action.act(delta); }
@Override protected boolean delegate(float delta) { if (framesLeft > 0) { framesLeft--; return false; } if (action == null) return true; return action.act(delta); } }
protected boolean delegate (float delta) { if (action == null) return true; return action.act(delta * scale); }
protected boolean delegate (float delta) { if (executedCount == repeatCount) return true; if (action.act(delta)) { if (finished) return true; if (repeatCount > 0) executedCount++; if (executedCount == repeatCount) return true; if (action != null) action.restart(); } return false; }
public void act (float delta) { actions.iter(); Action action; while ((action = actions.next()) != null) { action.act(delta); if (action.isDone()) { action.finish(); actions.remove(); } } }
protected boolean delegate (float delta) { Array<Action> currentActions = target.getActions(); if (currentActions.size == 1) waitForActions.clear(); for (int i = waitForActions.size - 1; i >= 0; i--) { Action action = waitForActions.get(i); int index = currentActions.indexOf(action, true); if (index == -1) waitForActions.removeIndex(i); } if (waitForActions.size > 0) return false; return action.act(delta); } }