Package org.collebol.client
Class EJGEngine
java.lang.Object
org.collebol.client.EJGEngine
This abstract class representing the core engine for EJGEngine on the Client side.
This class is responsible for setting up and running the main window,
handling events, and managing renderers.
To use this engine, extend this class and implement the abstract methods:
setup(), register(), enable(), and disable().
For more information, please refer to the EJGEngine Wiki.
- Since:
- 1.0-dev
- Author:
- ColleBol - contact@collebol.org
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voiddisable()This method is called when the game is shutting down.abstract voidenable()This method is called right before theMainWindowis started.abstract voidregister()Registers components or panels required by the engine.voidsetEventHandler(ClientEventHandler eventHandler) <T extends GameInfo>
voidsetGameInfo(T gameInfo) abstract voidsetup()Performs any necessary initialization for the engine before theMainWindowis created.voidstart()Starts the engine by performing the following steps: Calls thesetup()method to perform any necessary initialization. Initializes the main window by creating an instance ofMainWindow. Creates an instance ofRenderHandlerto manage renderers. Registers the initial panel by callingMainWindow.registerPanel(Panel). Sets the initial panel to be displayed usingMainWindow.setPanel(int). Calls theenable()method to enable any necessary features or components. Runs the main loop of the window by callingMainWindow.run(). Calls thedisable()method to disable any necessary features or components after the main loop ends.
-
Constructor Details
-
EJGEngine
public EJGEngine()
-
-
Method Details
-
start
public void start()Starts the engine by performing the following steps:- Calls the
setup()method to perform any necessary initialization. - Initializes the main window by creating an instance of
MainWindow. - Creates an instance of
RenderHandlerto manage renderers. - Registers the initial panel by calling
MainWindow.registerPanel(Panel). - Sets the initial panel to be displayed using
MainWindow.setPanel(int). - Calls the
enable()method to enable any necessary features or components. - Runs the main loop of the window by calling
MainWindow.run(). - Calls the
disable()method to disable any necessary features or components after the main loop ends.
- Calls the
-
setup
public abstract void setup()Performs any necessary initialization for the engine before theMainWindowis created. This method should be implemented to set up resources, configurations, or other initial settings. -
register
public abstract void register()Registers components or panels required by the engine. This method should be implemented to add any necessary components or panels to the engine. -
enable
public abstract void enable()This method is called right before theMainWindowis started. This method should be implemented to activate any necessary features or components. -
disable
public abstract void disable()This method is called when the game is shutting down. This method should be implemented to deactivate any necessary features or components. -
getWindow
- Returns:
- the main window of the engine
-
getEventHandler
- Returns:
- the event handler associated with the engine
-
setEventHandler
- Parameters:
eventHandler- the event handler to be set
-
getRenderers
- Returns:
- the render register handler responsible for managing renderers
-
getSoundHandler
- Returns:
- the sound handler responsible for managing sound players and camera sound players
-
getComponentHandler
- Returns:
- the component handler responsible for managing components.
-
getEngineInfo
- Returns:
- info about the engine like: version, author etc.
-
getGameInfo
-
setGameInfo
-