Fix: complete refactor of TUI

Tests updated
This commit is contained in:
2026-06-10 22:15:32 +02:00
parent 8bd740e68a
commit 4ffe4c5352
31 changed files with 242 additions and 187 deletions
@@ -74,6 +74,11 @@ public class Building1 extends BuildingCard {
*/
@Override
public String toString() {
return super.toString() + " Icon: " + this.icon.toString().charAt(0);
return super.toString() + " (Icon:" + this.icon.toString().substring(0, 3) + ")";
}
@Override
public String toStringPlayer() {
return super.toStringPlayer() + " (Icon:" + this.icon.toString().substring(0, 3) + ")";
}
}
@@ -105,6 +105,11 @@ public class Building11 extends BuildingCard {
*/
@Override
public String toString() {
return super.toString() + " Icon: " + this.icon.toString().charAt(0) + " MP: " + this.PrestigeMul;
return super.toString() + "+" + this.icon.toString().substring(0, 3) + "×" + this.PrestigeMul;
}
@Override
public String toStringPlayer() {
return super.toStringPlayer() + " (\uD83C\uDFC5:" + this.icon.toString().substring(0, 3) + "×" + this.PrestigeMul + ")";
}
}
@@ -141,7 +141,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
* if {@code price <= 0}, or if {@code prestigeValue < 0}
*/
public BuildingCard(int effectId ,int era,int price,int prestigeValue) throws IllegalArgumentException{
this.effectId = effectId;
this(era,price,prestigeValue);
switch (effectId){
case 2:
this.effectType=EffectType.ON_EVENT;
@@ -168,7 +168,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
throw new IllegalArgumentException();
}
this(era,price,prestigeValue);
this.effectId = effectId;
}
/**
@@ -186,7 +186,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
* if {@code price <= 0}, or if {@code prestigeValue < 0}.
*/
public BuildingCard(String idIMG,int effectId ,int era,int price,int prestigeValue) throws IllegalArgumentException{
this.effectId = effectId;
this(idIMG,era,price,prestigeValue);
switch (effectId){
case 2:
this.effectType=EffectType.ON_EVENT;
@@ -213,7 +213,7 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
throw new IllegalArgumentException();
}
this(idIMG,era,price,prestigeValue);
this.effectId = effectId;
}
/**
@@ -274,6 +274,10 @@ public class BuildingCard extends PlayableCard implements Cloneable , BuildingEf
*/
@Override
public String toString() {
return ":" + " ID:" + String.valueOf(getEffectId())+ " \uD83C\uDF56:"+String.valueOf(getPrice())+" \uD83C\uDFC5:"+String.valueOf(getPrestigeValue());
return ":" + " ID:" + getEffectId()+ " \uD83C\uDF56:"+String.valueOf(getPrice())+" \uD83C\uDFC5:"+String.valueOf(getPrestigeValue());
}
public String toStringPlayer() {
return "ID:" + getEffectId();
}
}