diff --git a/src/main/java/it/polimi/ingsw/gc14/Model/PlayableCard.java b/src/main/java/it/polimi/ingsw/gc14/Model/PlayableCard.java index 7d3b418..6df2330 100644 --- a/src/main/java/it/polimi/ingsw/gc14/Model/PlayableCard.java +++ b/src/main/java/it/polimi/ingsw/gc14/Model/PlayableCard.java @@ -1,10 +1,31 @@ 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 { + + /** + * The era associated with this playable card. + */ private int Era; + + /** + * Returns the era of this playable card. + * + * @return the era of this playable card. + */ public int getEra(){ 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{ if (Era>0 && Era<4) { 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 public String toString() { return "Era:"+String.valueOf(Era);