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 ;
     }
 
     @Override
     public void onStart() {
         this..onStart();
     }
 
     @Override
     public void onStop() {
         this..onStart();
     }
 
     @Override
     public void onRender() {
         this..clear();
 
         this..onRender();
 
         this..getGraphics().drawImage(this..getImage(), 0, 0, null);
 
         this..onPostRender(this..getGraphics());
     }
 
     @Override
     public void onUpdate() {
         this..onUpdate();
     }
 
    @Override
    public String getGameName() {
        return this..getGameName();
    }
    @Override
    public void onUpdatePS() {
        this..onUpdatePS();
    }
    public IRender getRender() {
        return ;
    }
    public CanvasEngine getEngine() {
        return ;
    }
New to GrepCode? Check out our FAQ X