com.harium.etyl.loader.async.AsyncResourceNotifier Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of etyl-gdx Show documentation
Show all versions of etyl-gdx Show documentation
An Etyl's backend based on libgdx
package com.harium.etyl.loader.async;
import java.util.ArrayList;
import java.util.List;
import com.harium.etyl.loader.LoadListener;
public abstract class AsyncResourceNotifier implements AsyncResource {
private List listeners;
protected void notifyListeners() {
if (listeners != null && listeners.isEmpty()) {
for (LoadListener listener : listeners) {
listener.onLoad();
}
}
}
public void addLoadListener(LoadListener loadListener) {
if (listeners == null) {
listeners = new ArrayList<>();
}
listeners.add(loadListener);
}
}