Add: Javadoc for PlayableCard class
This commit is contained in:
@@ -1,10 +1,31 @@
|
|||||||
package it.polimi.ingsw.gc14.Model;
|
package it.polimi.ingsw.gc14.Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Abstract base class for all playable cards.
|
||||||
|
* A PlayableCard is characterized by an era value.
|
||||||
|
*/
|
||||||
public abstract class PlayableCard {
|
public abstract class PlayableCard {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The era associated with this playable card.
|
||||||
|
*/
|
||||||
private int Era;
|
private int Era;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the era of this playable card.
|
||||||
|
*
|
||||||
|
* @return the era of this playable card.
|
||||||
|
*/
|
||||||
public int getEra(){
|
public int getEra(){
|
||||||
return Era;
|
return Era;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a playable card with the specified era.
|
||||||
|
*
|
||||||
|
* @param Era the era of the playable card.
|
||||||
|
* @throws IllegalArgumentException if {@code Era <= 0} or {@code Era >= 4}.
|
||||||
|
*/
|
||||||
public PlayableCard (int Era) throws IllegalArgumentException{
|
public PlayableCard (int Era) throws IllegalArgumentException{
|
||||||
if (Era>0 && Era<4) {
|
if (Era>0 && Era<4) {
|
||||||
this.Era = Era;
|
this.Era = Era;
|
||||||
@@ -13,6 +34,11 @@ public abstract class PlayableCard {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the string representation of this playable card.
|
||||||
|
*
|
||||||
|
* @return the string representation of this playable card.
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "Era:"+String.valueOf(Era);
|
return "Era:"+String.valueOf(Era);
|
||||||
|
|||||||
Reference in New Issue
Block a user