All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.czyzby.autumn.mvc.component.ui.dto.ThemesAssignmentAction Maven / Gradle / Ivy

Go to download

MVC framework based on LibGDX using Autumn for components management and LML as view templates.

There is a newer version: 1.9.1.9.6
Show newest version
package com.github.czyzby.autumn.mvc.component.ui.dto;

import com.badlogic.gdx.audio.Music;
import com.badlogic.gdx.utils.Array;
import com.github.czyzby.autumn.mvc.component.asset.AssetService;
import com.github.czyzby.autumn.mvc.component.ui.controller.impl.AnnotatedViewController;

/** Utility action executed after all themes are loaded.
 *
 * @author MJ */
public class ThemesAssignmentAction implements Runnable {
    private final String[] themes;
    private final AnnotatedViewController viewConroller;
    private final AssetService assetService;

    public ThemesAssignmentAction(final String[] themes, final AnnotatedViewController viewConroller,
            final AssetService assetService) {
        this.themes = themes;
        this.viewConroller = viewConroller;
        this.assetService = assetService;
    }

    @Override
    public void run() {
        final Array musicThemes = viewConroller.getThemes();
        for (final String theme : themes) {
            musicThemes.add(assetService.get(theme, Music.class));
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy