Class ScriptUtils


  • public class ScriptUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @NotNull java.lang.String chooseDefaultScriptName​(@NotNull java.io.File baseDir, java.lang.String archetypeName, java.lang.String scriptEnding, @NotNull PathManager pathManager)
      Try to create a reasonable default script name for lazy users.
      static @NotNull java.lang.String localizeEventPath​(@NotNull java.io.File localMapDir, java.io.File f, @NotNull java.io.File mapDir)
      This method is called when the user selects a new event to be created.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • localizeEventPath

        @NotNull
        public static @NotNull java.lang.String localizeEventPath​(@NotNull
                                                                  @NotNull java.io.File localMapDir,
                                                                  java.io.File f,
                                                                  @NotNull
                                                                  @NotNull java.io.File mapDir)
        This method is called when the user selects a new event to be created. The path relative to the map dir is calculated, and if reasonable, a relative path is created (relative to the map the event is on).
        Parameters:
        localMapDir - the base directory
        f - script file
        mapDir - the map directory
        Returns:
        local event path
      • chooseDefaultScriptName

        @NotNull
        public static @NotNull java.lang.String chooseDefaultScriptName​(@NotNull
                                                                        @NotNull java.io.File baseDir,
                                                                        java.lang.String archetypeName,
                                                                        java.lang.String scriptEnding,
                                                                        @NotNull
                                                                        @NotNull PathManager pathManager)
        Try to create a reasonable default script name for lazy users.
        Parameters:
        baseDir - the base dir for the default script name
        archetypeName - the best suitable name for the archetype (see GameObject.getBestName())
        scriptEnding - the ending for scripts
        pathManager - the path manager for converting path names
        Returns:
        a nice default script name without whitespaces