Class CommonObjective

java.lang.Object
it.polimi.ingsw.model.CommonObjective
All Implemented Interfaces:
Serializable

public class CommonObjective extends Object implements Serializable
class which represent the common objectives which all the players must try to achieve. Immutable
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Strategy
    the algorithm chosen, related to the specific common objective
    int
    the columns of the library that will be checked by the objective
    final int
    the unique identifier of the objective
    final String
     
    int
    the rows of the library that will be checked by the objective
  • Constructor Summary

    Constructors
    Constructor
    Description
    CommonObjective(Strategy algo, int identify)
    normal constructor for this type of objects
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    placeholder function, which will be overwritten by the subclasses, it draws itself
    void
    draw(int points)
    method that draws this objective

    Methods inherited from class java.lang.Object

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

    • algorithm

      public final Strategy algorithm
      the algorithm chosen, related to the specific common objective
    • id

      public final int id
      the unique identifier of the objective
    • imagePath

      public final String imagePath
    • ROWS

      public int ROWS
      the rows of the library that will be checked by the objective
    • COLS

      public int COLS
      the columns of the library that will be checked by the objective
  • Constructor Details

    • CommonObjective

      public CommonObjective(Strategy algo, int identify)
      normal constructor for this type of objects
      Parameters:
      algo - the algorithm used, depends on the objective chosen
      identify - the unique identifier of this objective
  • Method Details

    • draw

      public void draw(int points)
      method that draws this objective
      Parameters:
      points - the points still available for this objective
    • draw

      public void draw()
      placeholder function, which will be overwritten by the subclasses, it draws itself