package eu.jonahbauer.wizard.client.libgdx.actions;

import com.badlogic.gdx.scenes.scene2d.Action;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.Group;
import com.badlogic.gdx.scenes.scene2d.actions.Actions;

public class MyActions extends Actions {
    public static ChangeParentAction changeParent(Group parent) {
        var action = action(ChangeParentAction.class);
        action.setParent(parent);
        return action;
    }

    public static <T extends Action> T target(T action, Actor target) {
        action.setTarget(target);
        return action;
    }

    static public SilentlyRemoveActorAction removeActorSilently () {
        return action(SilentlyRemoveActorAction.class);
    }

    static public SilentlyRemoveActorAction removeActorSilently(Actor removeActor) {
        var action = action(SilentlyRemoveActorAction.class);
        action.setTarget(removeActor);
        return action;
    }

}
