parent
92056f3418
commit
7db4f8b94e
@ -0,0 +1,46 @@ |
||||
package mightypork.gamecore.core.init; |
||||
|
||||
|
||||
/** |
||||
* Init task that can be extended to initialize additional stuff in the |
||||
* application. |
||||
* |
||||
* @author Ondřej Hruška (MightyPork) |
||||
*/ |
||||
public abstract class InitTaskCustom extends InitTask { |
||||
|
||||
private final String name; |
||||
private final String[] deps; |
||||
|
||||
|
||||
public InitTaskCustom(String name) |
||||
{ |
||||
this(name, null); |
||||
} |
||||
|
||||
|
||||
public InitTaskCustom(String name, String[] dependencies) |
||||
{ |
||||
this.name = name; |
||||
this.deps = dependencies; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public abstract void run(); |
||||
|
||||
|
||||
@Override |
||||
public String getName() |
||||
{ |
||||
return name; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public String[] getDependencies() |
||||
{ |
||||
return deps; |
||||
} |
||||
|
||||
} |
@ -0,0 +1,42 @@ |
||||
package mightypork.gamecore.core.init; |
||||
|
||||
|
||||
import mightypork.gamecore.graphics.Renderable; |
||||
|
||||
|
||||
/** |
||||
* Task to init renderable screens (part of the main loop).<br> |
||||
* Resources must already be ready. |
||||
* |
||||
* @author Ondřej Hruška (MightyPork) |
||||
*/ |
||||
public abstract class InitTaskScreens extends InitTask { |
||||
|
||||
@Override |
||||
public void run() |
||||
{ |
||||
app.setMainRenderable(getMainRenderableImpl()); |
||||
} |
||||
|
||||
|
||||
/** |
||||
* Create a loader impl |
||||
* |
||||
* @return loader |
||||
*/ |
||||
protected abstract Renderable getMainRenderableImpl(); |
||||
|
||||
|
||||
@Override |
||||
public String getName() |
||||
{ |
||||
return "renderables"; |
||||
} |
||||
|
||||
|
||||
@Override |
||||
public String[] getDependencies() |
||||
{ |
||||
return new String[] { "resources", "main_loop" }; |
||||
} |
||||
} |
@ -0,0 +1,7 @@ |
||||
package mightypork.gamecore.core.plugins.screenshot; |
||||
|
||||
|
||||
public interface ScreenshotRequestListener { |
||||
|
||||
void onScreenshotRequest(); |
||||
} |
Loading…
Reference in new issue