public class AbstractGameFactory
GameFactories provide RetroWar with info about a game and generate an instance of the game on demand, applying any configuration that has been stored in the factory.
If you are making a stand-alone SimpleGame you don't need this, just create a SimpleGameFactory. But if you are making a plugin for RetroWar then you need to write your own subclass of AbstractGameFactory.
Constructor and Description |
---|
AbstractGameFactory(java.lang.String name,
java.util.List<uk.co.electronstudio.retrowar.LevelLoader> levels,
java.lang.String pathPrefix)
GameFactories provide RetroWar with info about a game and generate an
instance of the game on demand, applying any configuration that has been
stored in the factory.
|
AbstractGameFactory()
GameFactories provide RetroWar with info about a game and generate an
instance of the game on demand, applying any configuration that has been
stored in the factory.
|
Modifier and Type | Method and Description |
---|---|
Game |
create(GameSession session) |
Game |
createWithSimpleSettings(GameSession session)
Override if you want to compile a stand-alone SimpleGame with different settings
|
Game |
createWithTournamentSettings(GameSession session)
For mult-game tournaments ignore the settings in this factory and create a game with some
defaults appropriate for a tournament
|
java.lang.String |
getDescription()
Description displayed on menu
|
com.badlogic.gdx.graphics.Texture |
getImage()
Texture screenshot or logo to display on menu
|
int |
getLevel()
Currently selected level number
|
java.util.Vector<com.badlogic.gdx.graphics.Texture> |
getLevelImages() |
java.util.List<uk.co.electronstudio.retrowar.LevelLoader> |
getLevels()
a List of level names,
|
java.lang.String |
getName()
Game name
|
java.util.List<uk.co.electronstudio.retrowar.menu.MenuItem> |
getOptions()
Any MenuItems in this List will be displayed by RetroWar on an option screen
It's a way to configure the Factory via a GUI
If there are none, just leave List empty
|
java.lang.String |
getPathPrefix() |
boolean |
getShowOnGamesMenu()
Whether the game should be shown on the main menu or relegated to the 'mods' menu
|
void |
setLevel(int p)
Currently selected level number
|
void |
setShowOnGamesMenu(boolean p)
Whether the game should be shown on the main menu or relegated to the 'mods' menu
|
public AbstractGameFactory(java.lang.String name, java.util.List<uk.co.electronstudio.retrowar.LevelLoader> levels, java.lang.String pathPrefix)
GameFactories provide RetroWar with info about a game and generate an instance of the game on demand, applying any configuration that has been stored in the factory.
If you are making a stand-alone SimpleGame you don't need this, just create a SimpleGameFactory. But if you are making a plugin for RetroWar then you need to write your own subclass of AbstractGameFactory.
levels
- a List of level names, only for games that have multiple levels. May be null.public AbstractGameFactory()
GameFactories provide RetroWar with info about a game and generate an instance of the game on demand, applying any configuration that has been stored in the factory.
If you are making a stand-alone SimpleGame you don't need this, just create a SimpleGameFactory. But if you are making a plugin for RetroWar then you need to write your own subclass of AbstractGameFactory.
public int getLevel()
Currently selected level number
public void setLevel(int p)
Currently selected level number
public boolean getShowOnGamesMenu()
Whether the game should be shown on the main menu or relegated to the 'mods' menu
public void setShowOnGamesMenu(boolean p)
Whether the game should be shown on the main menu or relegated to the 'mods' menu
public com.badlogic.gdx.graphics.Texture getImage()
Texture screenshot or logo to display on menu
public java.lang.String getName()
Game name
public java.util.Vector<com.badlogic.gdx.graphics.Texture> getLevelImages()
public java.lang.String getDescription()
Description displayed on menu
public Game create(GameSession session)
public Game createWithTournamentSettings(GameSession session)
For mult-game tournaments ignore the settings in this factory and create a game with some defaults appropriate for a tournament
public Game createWithSimpleSettings(GameSession session)
Override if you want to compile a stand-alone SimpleGame with different settings
public java.util.List<uk.co.electronstudio.retrowar.menu.MenuItem> getOptions()
Any MenuItems in this List will be displayed by RetroWar on an option screen It's a way to configure the Factory via a GUI If there are none, just leave List empty
public java.util.List<uk.co.electronstudio.retrowar.LevelLoader> getLevels()
a List of level names,
only for games that have multiple levels. May be null.
public java.lang.String getPathPrefix()