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 booleanequals(java.lang.Object o)Compares the argument to the receiver, and answers true if their names, number of workers and description are equalsjava.lang.StringgetDescriptionStrategy()descriptionStrategy getterjava.lang.StringgetName()name getterintgetWorkersNumber()workersNumber getterinthashCode()
-
Constructor Details
-
GodData
public GodData(java.lang.String name, int workersNumber, java.lang.String descriptionStrategy)Default constructor- Parameters:
name- the god nameworkersNumber- the number of workers granted from the god powerdescriptionStrategy- 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:
equalsin classjava.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:
hashCodein classjava.lang.Object
-