-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make generic arguments on screen optional
- Loading branch information
Showing
3 changed files
with
31 additions
and
16 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
2d/src/main/java/de/bitbrain/braingdx/screen/AbstractBrainGdxScreen2D.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package de.bitbrain.braingdx.screen; | ||
|
||
import de.bitbrain.braingdx.BrainGdxGame; | ||
import de.bitbrain.braingdx.context.GameContext2D; | ||
import de.bitbrain.braingdx.context.GameContext2DImpl; | ||
import de.bitbrain.braingdx.graphics.shader.ShaderConfig; | ||
import de.bitbrain.braingdx.screens.AbstractScreen; | ||
import de.bitbrain.braingdx.util.ArgumentFactory; | ||
|
||
public abstract class AbstractBrainGdxScreen2D<T extends BrainGdxGame, C extends GameContext2D> extends AbstractScreen<T, C> { | ||
|
||
public AbstractBrainGdxScreen2D(final T game) { | ||
super(game, new ArgumentFactory<AbstractScreen<T, C>, C>() { | ||
@Override | ||
public C create(AbstractScreen<T, C> screen) { | ||
return (C) new GameContext2DImpl(screen.getViewportFactory(), new ShaderConfig(), game, screen); | ||
} | ||
}); | ||
} | ||
|
||
public AbstractBrainGdxScreen2D(final T game, ArgumentFactory<AbstractScreen<T, C>, C> argumentFactory) { | ||
super(game, argumentFactory); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters