Add: idIMG constructor
This commit is contained in:
@@ -8,6 +8,11 @@ import java.io.Serializable;
|
||||
*/
|
||||
public abstract class PlayableCard implements Serializable {
|
||||
|
||||
private String idIMG;
|
||||
public String getIdIMG() {
|
||||
return idIMG;
|
||||
}
|
||||
|
||||
/**
|
||||
* The era associated with this playable card.
|
||||
*/
|
||||
@@ -29,6 +34,22 @@ public abstract class PlayableCard implements Serializable {
|
||||
* @throws IllegalArgumentException if {@code Era <= 0} or {@code Era >= 4}.
|
||||
*/
|
||||
public PlayableCard (int Era) throws IllegalArgumentException{
|
||||
idIMG="-1";
|
||||
if (Era>0 && Era<4) {
|
||||
this.Era = Era;
|
||||
} else {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 (String idIMG,int Era) throws IllegalArgumentException{
|
||||
this.idIMG = idIMG;
|
||||
if (Era>0 && Era<4) {
|
||||
this.Era = Era;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user