use of com.bladecoder.engine.assets.AssetConsumer in project bladecoder-adventure-engine by bladecoder.
the class MoveToSceneAction method run.
@Override
public boolean run(VerbRunner cb) {
final Scene s = actor.getScene();
final String actorId = actor.getActorId();
final World w = World.getInstance();
if (actorId == null) {
// if called in a scene verb and no actor is specified, we do nothing
EngineLogger.error(getClass() + ": No actor specified");
return false;
}
InteractiveActor a = (InteractiveActor) s.getActor(actorId, false);
s.removeActor(a);
if (s == w.getCurrentScene() && a instanceof Disposable)
((Disposable) a).dispose();
Scene ts = null;
if (scene == null)
ts = w.getCurrentScene();
else
ts = w.getScene(scene);
// the scene is cached.
if ((ts == w.getCurrentScene() || w.getCachedScene(ts.getId()) != null) && a instanceof AssetConsumer) {
((AssetConsumer) a).loadAssets();
EngineAssetManager.getInstance().finishLoading();
((AssetConsumer) a).retrieveAssets();
}
ts.addActor(a);
return false;
}
Aggregations