Class StatefulEffect

java.lang.Object
it.polimi.ingsw.Model.CharacterCard
it.polimi.ingsw.Model.StatefulEffect
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Card01, Card05, Card07, Card11

public abstract class StatefulEffect extends CharacterCard implements Serializable
A CharacterCard that implements an effect linked to some internal state
See Also:
  • Field Details

  • Constructor Details

    • StatefulEffect

      public StatefulEffect(int id, int cost, StateType stateType, Model context)
      Construct a stateful card object
      Parameters:
      id - the ID of the card
      cost - the cost of the card
      stateType - the StateType of the card
      context - a reference to the Model, to apply the effect.
  • Method Details

    • getState

      public abstract List<Object> getState()
      Get the internal state of the card. Use getStateType() to know how to interpret it.
      Returns:
      a List of the state objects
    • getStateType

      public abstract StateType getStateType()
      Get the type of state this card uses.
      Returns:
      a variant of StateType