com.github.czyzby.autumn.mvc.component.ui.dto.ThemesAssignmentAction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gdx-autumn-mvc Show documentation
Show all versions of gdx-autumn-mvc Show documentation
MVC framework based on LibGDX using Autumn for components management and LML as view templates.
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