Class KeywordValidator<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>

  • Type Parameters:
    G - the game object type of the object
    A - the map arch object type of the object
    R - the archetype type of the object

    public class KeywordValidator<G extends GameObject<G,​A,​R>,​A extends MapArchObject<A>,​R extends Archetype<G,​A,​R>>
    extends java.lang.Object
    Checks that the matched keywords are correct.
    • Constructor Summary

      Constructors 
      Constructor Description
      KeywordValidator()
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void eof​(@NotNull ErrorGenerator<G,​A,​R> generator)
      Will be called at the end of processing.
      void match​(@NotNull ErrorGenerator<G,​A,​R> generator, @NotNull java.lang.Iterable<java.lang.String> matchKeywords)
      Processes a @match line.
      void reply​(@NotNull ErrorGenerator<G,​A,​R> generator, @NotNull java.lang.String command, @NotNull java.lang.String keyword)
      Processes a @reply or @question line.
      void reset()
      Resets the checker state.
      • Methods inherited from class java.lang.Object

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

      • KeywordValidator

        public KeywordValidator()
        Creates a new instance.
    • Method Detail

      • reset

        public void reset()
        Resets the checker state. Afterwards the state is the same as if a new instance was created.
      • match

        public void match​(@NotNull
                          @NotNull ErrorGenerator<G,​A,​R> generator,
                          @NotNull
                          @NotNull java.lang.Iterable<java.lang.String> matchKeywords)
        Processes a @match line.
        Parameters:
        generator - the generator for error messages
        matchKeywords - the list of keywords in the @match line
      • reply

        public void reply​(@NotNull
                          @NotNull ErrorGenerator<G,​A,​R> generator,
                          @NotNull
                          @NotNull java.lang.String command,
                          @NotNull
                          @NotNull java.lang.String keyword)
        Processes a @reply or @question line.
        Parameters:
        generator - the generator for error messages
        command - the command; either '@reply' or '@question'
        keyword - the keyword in the @reply or @question line
      • eof

        public void eof​(@NotNull
                        @NotNull ErrorGenerator<G,​A,​R> generator)
        Will be called at the end of processing.
        Parameters:
        generator - the generator for error messages