Fix: character implementation
This commit is contained in:
@@ -1,4 +1,20 @@
|
|||||||
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
||||||
|
|
||||||
public class Artist {
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||||
|
|
||||||
|
public class Artist extends Character {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* param Era artist era
|
||||||
|
*/
|
||||||
|
public Artist(int Era) {
|
||||||
|
super(Era, CharacterType.ARTIST);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return super.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,28 @@
|
|||||||
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
||||||
|
|
||||||
public class Builder {
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||||
|
|
||||||
|
public class Builder extends Character
|
||||||
|
{
|
||||||
|
private int reductionValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return Builder specific reduction value
|
||||||
|
*/
|
||||||
|
public int getReductionValue() {
|
||||||
|
return reductionValue;
|
||||||
|
}
|
||||||
|
public Builder(int Era, int reductionValue) throws IllegalArgumentException {
|
||||||
|
super(Era,CharacterType.BUILDER);
|
||||||
|
if(reductionValue < 0) {
|
||||||
|
throw new IllegalArgumentException();
|
||||||
|
}
|
||||||
|
this.reductionValue = reductionValue;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() { return super.toString()+" Reduction Value: " + String.valueOf(reductionValue);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+16
-1
@@ -1,4 +1,19 @@
|
|||||||
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
||||||
|
|
||||||
public class Gatherers {
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||||
|
|
||||||
|
public class Gatherers extends Character {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param Era gatherers era
|
||||||
|
*/
|
||||||
|
public Gatherers(int Era) {
|
||||||
|
super(Era, CharacterType.GATHERERS);
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return super.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,31 @@
|
|||||||
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
||||||
|
|
||||||
public class Hunter {
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||||
|
|
||||||
|
public class Hunter extends Character {
|
||||||
|
private boolean icon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return Hunter specific icon
|
||||||
|
*/
|
||||||
|
public boolean getIcon() {
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param Era hunter era
|
||||||
|
* @param icon hunter icon
|
||||||
|
*/
|
||||||
|
public Hunter(int Era, boolean icon) {
|
||||||
|
super(Era, CharacterType.HUNTER);
|
||||||
|
this.icon = icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return super.toString() + "Icon: " + String.valueOf(icon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,31 @@
|
|||||||
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
package it.polimi.ingsw.gc14.Model.Cards.TribeCards.Characters;
|
||||||
|
|
||||||
public class Shaman {
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||||
|
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||||
|
|
||||||
|
public class Shaman extends Character {
|
||||||
|
|
||||||
|
private int icon;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return Shaman specific icon
|
||||||
|
*/
|
||||||
|
public int getIcon() {
|
||||||
|
return icon;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param Era shaman era
|
||||||
|
* @param icon shaman icon
|
||||||
|
*/
|
||||||
|
public Shaman(int Era, int icon) {
|
||||||
|
super(Era, CharacterType.SHAMAN);
|
||||||
|
this.icon = icon;
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return super.toString() + "icon: " + String.valueOf(icon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ module it.polimi.ingsw.gc14 {
|
|||||||
|
|
||||||
requires org.controlsfx.controls;
|
requires org.controlsfx.controls;
|
||||||
requires java.rmi;
|
requires java.rmi;
|
||||||
|
requires it.polimi.ingsw.gc14;
|
||||||
|
|
||||||
opens it.polimi.ingsw.gc14 to javafx.fxml;
|
opens it.polimi.ingsw.gc14 to javafx.fxml;
|
||||||
exports it.polimi.ingsw.gc14;
|
exports it.polimi.ingsw.gc14;
|
||||||
|
|||||||
Reference in New Issue
Block a user