Package net.sf.gridarta.model.scripts
Class ScriptUtils
- java.lang.Object
-
- net.sf.gridarta.model.scripts.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.StringchooseDefaultScriptName(@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.StringlocalizeEventPath(@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.
-
-
-
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 directoryf- script filemapDir- 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 namearchetypeName- the best suitable name for the archetype (see GameObject.getBestName())scriptEnding- the ending for scriptspathManager- the path manager for converting path names- Returns:
- a nice default script name without whitespaces
-
-