Class GameObjectUtils


  • public class GameObjectUtils
    extends java.lang.Object
    Utility class for GameObject related functions.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static @Nullable java.lang.String getSyntaxErrors​(@NotNull BaseObject<?,​?,​?,​?> gameObject, @NotNull ArchetypeType type)
      This method checks the objectText for syntax errors.
      • Methods inherited from class java.lang.Object

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

      • getSyntaxErrors

        @Nullable
        public static @Nullable java.lang.String getSyntaxErrors​(@NotNull
                                                                 @NotNull BaseObject<?,​?,​?,​?> gameObject,
                                                                 @NotNull
                                                                 @NotNull ArchetypeType type)
        This method checks the objectText for syntax errors. More precisely: It reads every line in the objectText and looks if it matches the type-definitions (-> see ArchetypeTypeSet) for this base object. If there is no match, the line is considered wrong. Of course the type-definitions will never be perfect, this should be kept in mind.

        Note that the archetype is ignored in the check. The default arches should be correct, and even if not - it isn't the map maker to blame.

        Parameters:
        gameObject - the game object to check
        type - the type structure belonging to this base object
        Returns:
        a String with all lines which don't match the type-definitions.
        If no such "errors" encountered, null is returned