Interface ModManager


  • public interface ModManager
    ModManager holds and manages mods. It also provides aggregates for other subsystems that are coupled to mods.
    • Method Detail

      • 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.
      • 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.
      • getAll

        List<Mod> getAll()
        Returns all mod descriptors
      • getActive

        List<Mod> getActive()
        Returns mod descriptors of all active mods
      • getActiveNames

        List<String> getActiveNames()
        Returns the names of all active mods
      • getByName

        Mod getByName​(String name)
        Returns a mod descriptor by name
      • 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)