Module AM37

Class GodData

java.lang.Object
it.polimi.ingsw.dataClass.GodData

public class GodData
extends java.lang.Object
A data class for God

It can be useful to send game information over the network, without any reference to the actual game object.

  • Constructor Summary

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

    Modifier and Type Method Description
    boolean equals​(java.lang.Object o)
    Compares the argument to the receiver, and answers true if their names, number of workers and description are equals
    java.lang.String getDescriptionStrategy()
    descriptionStrategy getter
    java.lang.String getName()
    name getter
    int getWorkersNumber()
    workersNumber getter
    int hashCode()  

    Methods inherited from class java.lang.Object

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

    • GodData

      public GodData​(java.lang.String name, int workersNumber, java.lang.String descriptionStrategy)
      Default constructor
      Parameters:
      name - the god name
      workersNumber - the number of workers granted from the god power
      descriptionStrategy - a description of the god power
  • Method Details

    • getName

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

      public int getWorkersNumber()
      workersNumber getter
      Returns:
      the number of workers granted from the god power
    • getDescriptionStrategy

      public java.lang.String getDescriptionStrategy()
      descriptionStrategy getter
      Returns:
      a description of the go power
    • equals

      public boolean equals​(java.lang.Object o)
      Compares the argument to the receiver, and answers true if their names, number of workers and description are equals
      Overrides:
      equals in class java.lang.Object
      Parameters:
      o - the object to be
      Returns:
      true if the object is the same as the cell, false otherwise
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class java.lang.Object