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 equalsjava.lang.String
getDescriptionStrategy()
descriptionStrategy getterjava.lang.String
getName()
name getterint
getWorkersNumber()
workersNumber getterint
hashCode()
-
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:
equals
in 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:
hashCode
in classjava.lang.Object
-