Module AM37

Class God

java.lang.Object
it.polimi.ingsw.model.God

public class God
extends java.lang.Object
Representation of a god card and its effect
  • Constructor Summary

    Constructors 
    Constructor Description
    God​(java.lang.String name, int workersNumber, java.lang.String descriptionStrategy)
    Default constructor
  • Method Summary

    Modifier and Type Method Description
    GodData buildDataClass()
    Creates a GodData object based on this god
    God cloneGod​(Game game)
    Creates a clone of this god
    java.lang.String getDescriptionStrategy()
    description getter
    java.lang.String getName()
    name getter
    RuleSetStrategy getStrategy()
    strategy getter
    int getWorkersNumber()
    workersNumber getter
    void setStrategy​(RuleSetStrategy strategy)
    strategy setter

    Methods inherited from class java.lang.Object

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

    • God

      public God​(java.lang.String name, int workersNumber, java.lang.String descriptionStrategy)
      Default constructor
      Parameters:
      name - the god's name
      workersNumber - the number of workers associated to a given god
      descriptionStrategy - a description of the god's power
  • Method Details

    • cloneGod

      public God cloneGod​(Game game)
      Creates a clone of this god
      Parameters:
      game - the current game
      Returns:
      a clone of this object
    • getName

      public java.lang.String getName()
      name getter
      Returns:
      the god's name
    • getDescriptionStrategy

      public java.lang.String getDescriptionStrategy()
      description getter
      Returns:
      the god power description
    • getWorkersNumber

      public int getWorkersNumber()
      workersNumber getter
      Returns:
      the number of workers associated with the god power
    • getStrategy

      public RuleSetStrategy getStrategy()
      strategy getter
      Returns:
      the strategy associated with the god effects
    • setStrategy

      public void setStrategy​(RuleSetStrategy strategy)
      strategy setter
      Parameters:
      strategy - the strategy associated with thr god effects
    • buildDataClass

      public GodData buildDataClass()
      Creates a GodData object based on this god
      Returns:
      this object's data class