Class RatingModifierMK2

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static boolean DEBUG
      Debug flag.
      protected Field field
      Ratings for the points.
      protected int[][] rating
      Ratings for the points.
    • Constructor Summary

      Constructors 
      Constructor Description
      RatingModifierMK2​(Field f)
      Creates a new RatingModifier.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isDangerRating()
      Checks, if this a danger modifier.
      boolean isSelfMade()
      Checks, if this danger modifier is induced by figure itself.
      int modifyRating​(int x, int y, int rating)
      Modifies the rating of the given point by this modifiers rating.
      int modifyRating​(Point p, int rating)
      Modifies the rating of the given point by this modifiers rating.
      protected void resetRatings()
      Sets all point ratings to 0.
      protected void setRating​(int x, int y, int rating)  
      abstract boolean update()
      Updates after each round.
      • Methods inherited from class java.lang.Object

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

      • rating

        protected int[][] rating
        Ratings for the points.
      • field

        protected Field field
        Ratings for the points.
    • Constructor Detail

      • RatingModifierMK2

        public RatingModifierMK2​(Field f)
        Creates a new RatingModifier.
        Parameters:
        f - The field.
    • Method Detail

      • isDangerRating

        public boolean isDangerRating()
        Checks, if this a danger modifier.
        Returns:
        true by default.
      • isSelfMade

        public boolean isSelfMade()
        Checks, if this danger modifier is induced by figure itself.
        Returns:
        false by default.
      • modifyRating

        public int modifyRating​(Point p,
                                int rating)
        Modifies the rating of the given point by this modifiers rating.
        Parameters:
        p - The point.
        rating - The base rating.
        Returns:
        The modified rating.
      • modifyRating

        public int modifyRating​(int x,
                                int y,
                                int rating)
        Modifies the rating of the given point by this modifiers rating.
        Parameters:
        x - The point x coordinate.
        y - The point y coordinate.
        rating - The base rating.
        Returns:
        The modified rating.
      • setRating

        protected void setRating​(int x,
                                 int y,
                                 int rating)
      • resetRatings

        protected void resetRatings()
        Sets all point ratings to 0.
      • update

        public abstract boolean update()
        Updates after each round.
        Returns:
        true, if modifier is still valid.