Class Strategy

java.lang.Object
it.polimi.ingsw.model.Strategy
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Algo_CO_1, Algo_CO_10, Algo_CO_11, Algo_CO_12, Algo_CO_2, Algo_CO_3, Algo_CO_4, Algo_CO_5, Algo_CO_6, Algo_CO_7, Algo_CO_8, Algo_CO_9

public class Strategy extends Object implements Serializable
class which formalize the Strategy Pattern. Immutable
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    the columns of the library that will be checked by the objective
    int
    the rows of the library that will be checked by the objective
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    checkMatch(Card[][] board)
    check if the objective is achieved by the player library

    Methods inherited from class java.lang.Object

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

    • 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

    • Strategy

      public Strategy()
  • Method Details

    • checkMatch

      public boolean checkMatch(Card[][] board)
      check if the objective is achieved by the player library
      Parameters:
      board - the state of the library
      Returns:
      true iff the objective is achieved