2016-04-27 17:42:50 +02:00
|
|
|
package nautilus.game.arcade;
|
|
|
|
|
2016-06-25 19:11:08 +02:00
|
|
|
import mineplex.core.common.MinecraftVersion;
|
|
|
|
import mineplex.core.common.Pair;
|
2016-04-27 17:42:50 +02:00
|
|
|
import nautilus.game.arcade.game.Game;
|
|
|
|
|
|
|
|
/**
|
2016-05-15 10:24:29 +02:00
|
|
|
* This Object represents a Gamemode used in the GameType constructor
|
2016-04-27 17:42:50 +02:00
|
|
|
*
|
|
|
|
* @author xXVevzZXx
|
|
|
|
*/
|
|
|
|
public class GameMode
|
|
|
|
{
|
|
|
|
|
|
|
|
private Class<? extends Game> _gameMode;
|
2016-05-22 00:29:58 +02:00
|
|
|
private GameType _gameType;
|
2016-04-27 17:42:50 +02:00
|
|
|
private String _name;
|
|
|
|
|
2016-06-25 19:11:08 +02:00
|
|
|
private Pair<MinecraftVersion, String>[] _resourcePackUrls;
|
|
|
|
private boolean _enforceResourcePack;
|
|
|
|
|
2016-05-15 10:24:29 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param gameMode Game class that in most cases extends the host game class
|
|
|
|
* @param name Gamemode name
|
|
|
|
*/
|
2016-05-22 00:29:58 +02:00
|
|
|
public GameMode(Class<? extends Game> gameMode, GameType gameType, String name)
|
2016-06-25 19:11:08 +02:00
|
|
|
{
|
|
|
|
this(gameMode, gameType, name, null, false);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @param gameMode Game class that in most cases extends the host game class
|
|
|
|
* @param gameType original GameType of modded game
|
|
|
|
* @param name Gamemode name
|
|
|
|
* @param resourcePackUrls URLs to 1.8/1.9 resource pack
|
|
|
|
* @param enforceResourcePack enforece resource pack on players
|
|
|
|
*/
|
|
|
|
public GameMode(Class<? extends Game> gameMode, GameType gameType, String name, Pair<MinecraftVersion, String>[] resourcePackUrls, boolean enforceResourcePack)
|
2016-04-27 17:42:50 +02:00
|
|
|
{
|
|
|
|
_gameMode = gameMode;
|
2016-05-22 00:29:58 +02:00
|
|
|
_gameType = gameType;
|
2016-04-27 17:42:50 +02:00
|
|
|
_name = name;
|
2016-06-25 19:11:08 +02:00
|
|
|
_resourcePackUrls = resourcePackUrls;
|
|
|
|
_enforceResourcePack = enforceResourcePack;
|
2016-04-27 17:42:50 +02:00
|
|
|
}
|
|
|
|
|
2016-05-15 10:24:29 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return Game class
|
|
|
|
*/
|
2016-04-27 17:42:50 +02:00
|
|
|
public Class<? extends Game> getGameClass()
|
|
|
|
{
|
|
|
|
return _gameMode;
|
|
|
|
}
|
|
|
|
|
2016-05-15 10:24:29 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return Gamemode name
|
|
|
|
*/
|
2016-04-27 17:42:50 +02:00
|
|
|
public String getName()
|
|
|
|
{
|
|
|
|
return _name;
|
|
|
|
}
|
2016-05-22 00:29:58 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return Gamemode gametype
|
|
|
|
*/
|
|
|
|
public GameType getType()
|
|
|
|
{
|
|
|
|
return _gameType;
|
|
|
|
}
|
2016-06-25 19:11:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return Gamemode resource pack URLs
|
|
|
|
*/
|
|
|
|
public Pair<MinecraftVersion, String>[] getResPackURLs()
|
|
|
|
{
|
|
|
|
return _resourcePackUrls;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* @return Gamemode enforcing of resource packs
|
|
|
|
*/
|
|
|
|
public boolean enforceResourcePack()
|
|
|
|
{
|
|
|
|
return _enforceResourcePack;
|
|
|
|
}
|
2016-04-27 17:42:50 +02:00
|
|
|
|
|
|
|
}
|