Class ProblemFactory.MessageOrBattleProblem

    • Field Detail

      • faction

        protected Faction faction
      • region

        protected Region region
      • unit

        protected Unit unit
      • object

        protected java.lang.Object object
    • Constructor Detail

    • Method Detail

      • getLine

        public int getLine()
        Description copied from interface: Problem
        Returns the line in the orders of the unit that caused the problem. The first order is line 1!
        Specified by:
        getLine in interface Problem
        Returns:
        The line that is the cause of the order or -1 if no single line can be made responsible
        See Also:
        Problem.getLine()
      • getObject

        public java.lang.Object getObject()
        Description copied from interface: Problem
        Returns the object this problem criticizes.
        Specified by:
        getObject in interface Problem
        See Also:
        Problem.getObject()
      • getFaction

        public Faction getFaction()
        Description copied from interface: Problem
        Returns the faction this problem belongs to.
        Specified by:
        getFaction in interface Problem
        Returns:
        The faction this problem belongs to or null if not applicable
        See Also:
        Problem.getFaction()
      • getOwner

        public Unit getOwner()
        Description copied from interface: Problem
        Returns a unit responsible for this problem.
        Specified by:
        getOwner in interface Problem
        Returns:
        Returns owner.
        See Also:
        Problem.getOwner()
      • addSuppressComment

        public Unit addSuppressComment()
        Description copied from interface: 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.
        Specified by:
        addSuppressComment in interface Problem
        Returns:
        Returns a Unit whose orders were changed to suppress this warning or null if no orders were changed
        See Also:
        Problem.addSuppressComment()