Interface ModManager
-
public interface ModManager
ModManager holds and manages mods. It also provides aggregates for other subsystems that are coupled to mods.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
activate(List<String> mods)
boolean
activateGameMode(String gameModeName)
List<Mod>
getActive()
Returns mod descriptors of all active modsMod
getActiveByName(String name)
Returns a mod descriptor by name only if it's activeMap<String,MenuLaunchEntry>
getActiveMenuLaunchEntries()
Returns all menu launch entries from active modsList<String>
getActiveNames()
Returns the names of all active modsList<Mod>
getAll()
Returns all mod descriptors<T> T
getBusinessObject(Class<? extends T> clazz)
Returns an instance of a business object by clazz.Mod
getByName(String name)
Returns a mod descriptor by nameList<CompositeEntityFactory>
getCompositeEntityFactories()
Returns all composite entity factoriesGameModeDef
getGameModeByName(String gameModeName)
Returns a game mode definition by game mode nameList<GameModeDef>
getGameModeDefs()
Returns a view of all game mode definitionsboolean
isDirectoryRestricted(File file)
boolean
isModNameRestricted(String name)
void
loadAchievements()
(Re)loads all achievement definitions from active modsvoid
loadAllAchievements()
(Re)loads all achievement definitions from all modsInputStream
loadCumulativeResource(String resourceName)
Loads a resource from the mod static storage cumulative, returning the last occurence.InputStream
loadDefaultModResource(String resourceName)
Loads a resource from the mod static storage of the default mod (game-core).void
loadEntityDef()
(Re)loads all entity definitions from active modsInputStream
loadResource(Mod mod, String resourceName)
InputStream
loadResource(String modName, String resourceName)
Loads a resource from the mod static storage cumulative if modName is null, otherwise non-cumulative from the specified mod.void
loadShipClasses()
(Re)loads all ship classes from active mods
-
-
-
Method Detail
-
activate
@RestrictedMethod void activate(List<String> mods)
-
activateGameMode
@RestrictedMethod boolean activateGameMode(String gameModeName)
-
loadShipClasses
void loadShipClasses()
(Re)loads all ship classes from active mods
-
loadEntityDef
void loadEntityDef()
(Re)loads all entity definitions from active mods
-
loadAchievements
void loadAchievements()
(Re)loads all achievement definitions from active mods
-
loadAllAchievements
void loadAllAchievements()
(Re)loads all achievement definitions from all mods
-
loadResource
InputStream loadResource(String modName, String resourceName)
Loads a resource from the mod static storage cumulative if modName is null, otherwise non-cumulative from the specified mod. See also loadCumulativeResource for a more detailed explaination about cumulating resources.
-
loadResource
@RestrictedMethod InputStream loadResource(Mod mod, String resourceName)
-
loadDefaultModResource
InputStream loadDefaultModResource(String resourceName)
Loads a resource from the mod static storage of the default mod (game-core). It ignores other mods overriding resources.
-
loadCumulativeResource
InputStream loadCumulativeResource(String resourceName)
Loads a resource from the mod static storage cumulative, returning the last occurence. This makes it possible for mods to override data from other mods (e.g. a custom tileset mod can override tilesets from the game core).
-
getGameModeDefs
List<GameModeDef> getGameModeDefs()
Returns a view of all game mode definitions
-
getGameModeByName
GameModeDef getGameModeByName(String gameModeName)
Returns a game mode definition by game mode name
-
getBusinessObject
<T> T getBusinessObject(Class<? extends T> clazz)
Returns an instance of a business object by clazz. Business objects are stateless and implement game mechanics, thus the instance returned can be re-used.
-
getCompositeEntityFactories
List<CompositeEntityFactory> getCompositeEntityFactories()
Returns all composite entity factories
-
getActiveByName
Mod getActiveByName(String name)
Returns a mod descriptor by name only if it's active
-
getActiveMenuLaunchEntries
Map<String,MenuLaunchEntry> getActiveMenuLaunchEntries()
Returns all menu launch entries from active mods
-
isDirectoryRestricted
boolean isDirectoryRestricted(File file)
-
isModNameRestricted
boolean isModNameRestricted(String name)
-
-