Interface Inspector

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SUPPRESS_PREFIX
      All lines suppressing problems must start with this prefix.
      static java.lang.String SUPPRESS_PREFIX_PERMANENT  
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void addInterceptor​(InspectorInterceptor interceptor)
      Adds an interceptor to this Inspector.
      java.util.List<Problem> findProblems​(Unit u)
      Reviews a unit and returns the list of Problem objects which are of the given type.
      java.util.Collection<ProblemType> getTypes()
      Returns all ProblemTypes this Inspector may return.
      java.util.List<Problem> listProblems​(Region r)
      Reviews a region and returns the list of Problem objects which are of the given type.
      java.util.List<Problem> reviewFaction​(Faction f)
      Reviews global problems and returns a list of Problems.
      java.util.List<Problem> reviewGlobal()
      Reviews global problems and returns a list of Problems.
      java.util.List<Problem> reviewRegion​(Region r)
      Reviews a region and returns a list of Problem objects associated with it.
      java.util.List<Problem> reviewUnit​(Unit u)
      Reviews a unit and returns a list of Problem objects associated with it.
      void setGameData​(GameData gameData)
      Changes the GameData this inspector works on from now on.
      void setIgnore​(ProblemType type, boolean ignore)
      Tells this inspector whether to ignore certain problems.
      Unit suppress​(Problem problem)
      Modifies the orders such that this problem is not listed by the inspector in the future, i.e.
      void unSuppress​(Faction f)
      Removes all additions made by suppress of this Inspector to the faction.
      void unSuppress​(Region r)
      Removes all additions made by suppress of this Inspector to the region.
      void unSuppress​(Unit u)
      Removes all additions made by suppress of this Inspector to the Unit's orders.
      void unSuppressGlobal()
      Removes all additions made by suppress of this Inspector to the global objects.
    • Field Detail

      • SUPPRESS_PREFIX

        static final java.lang.String SUPPRESS_PREFIX
        All lines suppressing problems must start with this prefix.
        See Also:
        Constant Field Values
      • SUPPRESS_PREFIX_PERMANENT

        static final java.lang.String SUPPRESS_PREFIX_PERMANENT
        See Also:
        Constant Field Values
    • Method Detail

      • reviewGlobal

        java.util.List<Problem> reviewGlobal()
        Reviews global problems and returns a list of Problems.
      • reviewFaction

        java.util.List<Problem> reviewFaction​(Faction f)
        Reviews global problems and returns a list of Problems.
      • reviewUnit

        java.util.List<Problem> reviewUnit​(Unit u)
        Reviews a unit and returns a list of Problem objects associated with it.
      • findProblems

        java.util.List<Problem> findProblems​(Unit u)
        Reviews a unit and returns the list of Problem objects which are of the given type.
        Parameters:
        u - The unit to review
      • reviewRegion

        java.util.List<Problem> reviewRegion​(Region r)
        Reviews a region and returns a list of Problem objects associated with it.
      • listProblems

        java.util.List<Problem> listProblems​(Region r)
        Reviews a region and returns the list of Problem objects which are of the given type.
      • suppress

        Unit suppress​(Problem problem)
        Modifies the orders such that this problem is not listed by the inspector in the future, i.e. by adding a comment to the source unit's orders. Note that it is in the responsibility of the caller to fire OrderChangedEvents.
        Parameters:
        problem -
        Returns:
        Returns a unit whose orders were changed or null if this was not possible
      • unSuppress

        void unSuppress​(Unit u)
        Removes all additions made by suppress of this Inspector to the Unit's orders.
        Parameters:
        u -
      • unSuppress

        void unSuppress​(Region r)
        Removes all additions made by suppress of this Inspector to the region.
      • unSuppress

        void unSuppress​(Faction f)
        Removes all additions made by suppress of this Inspector to the faction.
      • unSuppressGlobal

        void unSuppressGlobal()
        Removes all additions made by suppress of this Inspector to the global objects.
      • getTypes

        java.util.Collection<ProblemType> getTypes()
        Returns all ProblemTypes this Inspector may return.
      • setGameData

        void setGameData​(GameData gameData)
        Changes the GameData this inspector works on from now on.
      • setIgnore

        void setIgnore​(ProblemType type,
                       boolean ignore)
        Tells this inspector whether to ignore certain problems. The inspector may choose to still return problems of the given type even if ignore==true.
        Parameters:
        type -
        ignore - If true, the inspector may choose to not return problems of this type.
      • addInterceptor

        void addInterceptor​(InspectorInterceptor interceptor)
        Adds an interceptor to this Inspector.