Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package io.github.aritzhack.aritzh.awt.gameEngine.test;
  
 
 import java.util.Map;

Simple engine that can be used to test things quickly. Uses io.github.aritzhack.aritzh.awt.gameEngine.CanvasEngine internally

Author(s):
Aritz Lopez
 
 public class TestEngine implements IGame {
 
 	private final ILogger LOGGER;
 	private final Map<StringSpritesprites;
 	private final CanvasEngine engine;
 	private final IRender render;
 	private final AbstractGame game;
 	private final int heightwidth;

Creates a TestEngine with the given game and size.

Parameters:
game The implementation of the game.
width The width of the game.
height The height of the game.
 
 	public TestEngine(AbstractGame gameint widthint height) {
 		this(gamewidthheightnullnull);
 	}

Creates a TestEngine with the given game and size.

Parameters:
game The implementation of the game.
width The width of the game.
height The height of the game.
logger The logger that the io.github.aritzhack.aritzh.awt.gameEngine.CanvasEngine will use.
sprites The sprites that the renderer will use.
 
 	public TestEngine(AbstractGame gameint widthint height, @Nullable ILogger logger, @Nullable Map<StringSpritesprites) {
 		this. = game;
 		this. = sprites;
 		this. = width;
 		this. = height;
 		this. = NullLogger.getLogger(logger);
 		this. = new CanvasEngine(thisthis.this.false);
 
 		if (this. != nullthis. = new BufferedImageRenderer(this.this.this.);
 		else this. = new BufferedImageRenderer(this.this.);
 
 		this..start();
 	}
 
 	public void start() {
 		this..start();
 	}
 
 	public int getWidth() {
 		return ;
 	}
 
 	public int getHeight() {
 		return ;
 	}
 
 	public void onStart() {
 		this..onStart();
 	}
 
 	public void onStop() {
 		this..onStart();
 	}
 
 	public void onRender() {
 		this..clear();
 
 		this..onRender();
 
 		this..getGraphics().drawImage(this..getImage(), 0, 0, null);
 
 	}
 
 	public void onUpdate() {
 		this..onUpdate();
 	}
 
	public String getGameName() {
		return this..getGameName();
	}
	public void onUpdatePS() {
	}
	public IRender getRender() {
		return ;
	}
	public CanvasEngine getEngine() {
		return ;
	}
New to GrepCode? Check out our FAQ X