Add: TODO.
This commit is contained in:
@@ -5,7 +5,6 @@ import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
public class Building13 extends BuildingCard{
|
||||
|
||||
/**
|
||||
* Creates a Building13 card with the specified era, price, and prestige value.
|
||||
*
|
||||
|
||||
@@ -4,9 +4,7 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.Character;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
public class Builder extends Character
|
||||
{
|
||||
|
||||
public class Builder extends Character {
|
||||
/**
|
||||
* The reduction value provided by this Builder card.
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,6 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
public class Gatherer extends Character {
|
||||
|
||||
/**
|
||||
* Creates a Gatherer character card with the specified era.
|
||||
*
|
||||
|
||||
@@ -6,8 +6,6 @@ import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
import it.polimi.ingsw.gc14.Model.Player;
|
||||
|
||||
public class Shaman extends Character {
|
||||
|
||||
|
||||
/**
|
||||
* The number of star {@code Icons} the card possesses.
|
||||
* During the {@link it.polimi.ingsw.gc14.Model.Cards.TribeCards.Events.ShamanicRitual Shamanic Ritual Event}, having the
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package it.polimi.ingsw.gc14.Model;
|
||||
|
||||
import com.google.gson.*;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.Building.EffectType;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.Building.Effects.*;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.BuildingCard;
|
||||
import it.polimi.ingsw.gc14.Model.Cards.TribeCards.CharacterType;
|
||||
@@ -16,9 +15,10 @@ import java.io.*;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
//TODO javadoc
|
||||
public class DecksCreator {
|
||||
|
||||
//TODO javadoc
|
||||
public static List<TribeCard> loadTribeDeckByEra(int era) throws IllegalArgumentException
|
||||
{
|
||||
return switch (era) {
|
||||
@@ -28,6 +28,8 @@ public class DecksCreator {
|
||||
default -> throw new IllegalArgumentException();
|
||||
};
|
||||
}
|
||||
|
||||
//TODO javadoc
|
||||
public static List<TribeCard> loadTribeDeck(String resourcePath) {
|
||||
Gson gson = new Gson();
|
||||
Type listType = new com.google.gson.reflect.TypeToken<List<TribeCardDefinition>>(){}.getType();
|
||||
@@ -48,11 +50,15 @@ public class DecksCreator {
|
||||
throw new RuntimeException("Errore caricamento mazzo: " + resourcePath, e);
|
||||
}
|
||||
}
|
||||
|
||||
//TODO javadoc
|
||||
public static List<BuildingCard> loadBuildingDeckByEra(int era) throws IllegalArgumentException
|
||||
{
|
||||
if(era<=0 || era>3) throw new IllegalArgumentException();
|
||||
return loadBuildingDeck("/Cards/buildingCards.json").stream().filter(x->x.getEra()==era).toList();
|
||||
}
|
||||
|
||||
//TODO javadoc
|
||||
public static List<BuildingCard> loadBuildingDeck(String resourcePath) {
|
||||
Gson gson = new Gson();
|
||||
Type listType = new com.google.gson.reflect.TypeToken<List<BuildingCardDefinition>>(){}.getType();
|
||||
@@ -74,6 +80,7 @@ public class DecksCreator {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO javadoc
|
||||
public static List<Slot> loadSlotDeck()
|
||||
{
|
||||
List<Slot> slots = new ArrayList<>();
|
||||
@@ -82,6 +89,8 @@ public class DecksCreator {
|
||||
slots.add(new Slot(c));
|
||||
return slots;
|
||||
}
|
||||
|
||||
//TODO javadoc
|
||||
private static TribeCard createCard(TribeCardDefinition def) {
|
||||
int era = def.era;
|
||||
|
||||
@@ -129,6 +138,7 @@ public class DecksCreator {
|
||||
};
|
||||
}
|
||||
|
||||
//TODO javadoc
|
||||
private static BuildingCard createCard(BuildingCardDefinition def) {
|
||||
return switch (def.effectId) {
|
||||
case 0 -> new Building0(def.era, def.price, def.prestigeValue);
|
||||
@@ -143,7 +153,7 @@ public class DecksCreator {
|
||||
|
||||
}
|
||||
|
||||
|
||||
//TODO javadoc
|
||||
private static class TribeCardDefinition {
|
||||
String type;
|
||||
int era;
|
||||
@@ -152,6 +162,7 @@ public class DecksCreator {
|
||||
List<Object> params; // Object per gestire boolean e int misti
|
||||
}
|
||||
|
||||
//TODO javadoc
|
||||
private static class BuildingCardDefinition {
|
||||
int effectId;
|
||||
int era;
|
||||
|
||||
Reference in New Issue
Block a user