<commit_before>package de.verygame.square.core.content;

import com.badlogic.gdx.Gdx;

import de.verygame.square.core.Content;
import de.verygame.square.core.ScreenContext;
import de.verygame.square.core.ScreenId;
import de.verygame.square.core.event.EventEmitter;
import de.verygame.square.resource.Resource;
import de.verygame.square.resource.ResourceHandler;
import de.verygame.square.util.glmenu.impl.GLMenuStage;

/**
 * @author <NAME>
 */
public abstract class UiContent extends EventEmitter implements Content {

    /** Resource handler which contains all ui resources */
    protected final ResourceHandler res;

    /** Stage, which loads the xml */
    protected GLMenuStage stage;

    /** Context of the screen */
    protected ScreenContext context;

    /**
     * Creates the user interface of the game.
     *
     *  @param res handler, which contains an applicable skin, the markup file and the language pack.
     */
    public UiContent(ResourceHandler res) {
        this.res = res;
    }

    /**
     * Should return the xml resource, which describes the xml of the glmenuStage.
     *
     * @return UiResource of the type XML
     */
    protected abstract Resource defineXML();

    @Override
    public void onBind(ScreenContext context) {
        this.context = context;

        this.stage = new GLMenuStage(context.getBatch(), res.getXMLAsStream(defineXML()), res);
        this.stage.setViewport(context.getViewport());
        this.stage.bind(this);
        this.stage.loadMenu();
    }

    @Override
    public void onActivate(ScreenId predecessor) {
        Gdx.input.setInputProcessor(stage);
    }

    @Override
    public void onUpdate() {
        stage.act();
    }

    @Override
    public void onRender() {
        stage.draw();
    }

    @Override
    public void dispose() {
        stage.dispose();
    }

    @Override
    public void onDeactivate(ScreenId successor) {
        //default: do nothing
    }

    @Override
    public void onResize(int width, int height) {
        //default: do nothing
    }

    @Override
    public void onPause() {
        //default: do nothing
    }

    @Override
    public void onResume() {
        //default: do nothing
    }
}
<commit_msg>Moved glmenu implementation.<commit_after>package de.verygame.square.core.content;

import com.badlogic.gdx.Gdx;

import de.verygame.square.core.Content;
import de.verygame.square.core.ScreenContext;
import de.verygame.square.core.ScreenId;
import de.verygame.square.core.event.EventEmitter;
import de.verygame.square.resource.Resource;
import de.verygame.square.resource.ResourceHandler;
import de.verygame.square.scene2d.glmenu.impl.GLMenuStage;

/**
 * @author <NAME>
 */
public abstract class UiContent extends EventEmitter implements Content {

    /** Resource handler which contains all ui resources */
    protected final ResourceHandler res;

    /** Stage, which loads the xml */
    protected GLMenuStage stage;

    /** Context of the screen */
    protected ScreenContext context;

    /**
     * Creates the user interface of the game.
     *
     *  @param res handler, which contains an applicable skin, the markup file and the language pack.
     */
    public UiContent(ResourceHandler res) {
        this.res = res;
    }

    /**
     * Should return the xml resource, which describes the xml of the glmenuStage.
     *
     * @return UiResource of the type XML
     */
    protected abstract Resource defineXML();

    @Override
    public void onBind(ScreenContext context) {
        this.context = context;

        this.stage = new GLMenuStage(context.getBatch(), res.getXMLAsStream(defineXML()), res);
        this.stage.setViewport(context.getViewport());
        this.stage.bind(this);
        this.stage.loadMenu();
    }

    @Override
    public void onActivate(ScreenId predecessor) {
        Gdx.input.setInputProcessor(stage);
    }

    @Override
    public void onUpdate() {
        stage.act();
    }

    @Override
    public void onRender() {
        stage.draw();
    }

    @Override
    public void dispose() {
        stage.dispose();
    }

    @Override
    public void onDeactivate(ScreenId successor) {
        //default: do nothing
    }

    @Override
    public void onResize(int width, int height) {
        //default: do nothing
    }

    @Override
    public void onPause() {
        //default: do nothing
    }

    @Override
    public void onResume() {
        //default: do nothing
    }
}

{'fraction_non_alphanumeric': 0.10075960679177837, 'fraction_numerical': 0.00022341376228775692, 'mean_word_length': 2.610483870967742, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1839423', 'n_tokens_mistral': 1287, 'n_tokens_neox': 1252, 'n_words': 344}