mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
does not force deck to have comment or playerType
This commit is contained in:
@@ -26,8 +26,8 @@ public final class Deck implements Comparable<Deck>, Serializable {
|
||||
|
||||
private String name;
|
||||
private String deckType;
|
||||
private String comment;
|
||||
private PlayerType playerType;
|
||||
private String comment = null;
|
||||
private PlayerType playerType = null;
|
||||
|
||||
private CardPool main;
|
||||
private CardPool sideboard;
|
||||
@@ -152,7 +152,7 @@ public final class Deck implements Comparable<Deck>, Serializable {
|
||||
* @return a {@link java.lang.String} object.
|
||||
*/
|
||||
public String getComment() {
|
||||
return comment == null ? "" : comment;
|
||||
return comment;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -463,14 +463,14 @@ public class DeckManager {
|
||||
* @param out a {@link java.io.BufferedWriter} object.
|
||||
* @throws java.io.IOException if any.
|
||||
*/
|
||||
private static void writeDeck(Deck d, BufferedWriter out) throws IOException {
|
||||
private static void writeDeck(final Deck d, final BufferedWriter out) throws IOException {
|
||||
out.write("[metadata]\n");
|
||||
|
||||
|
||||
out.write(format("%s=%s%n", NAME, d.getName().replaceAll("\n", "")));
|
||||
out.write(format("%s=%s%n", DECK_TYPE, d.getDeckType().replaceAll("\n", "")));
|
||||
out.write(format("%s=%s%n", COMMENT, d.getComment().replaceAll("\n", "")));
|
||||
out.write(format("%s=%s%n", PLAYER, d.getPlayerType()));
|
||||
// these are optional
|
||||
if (d.getComment() != null) { out.write(format("%s=%s%n", COMMENT, d.getComment().replaceAll("\n", ""))); }
|
||||
if (d.getPlayerType() != null) { out.write(format("%s=%s%n", PLAYER, d.getPlayerType())); }
|
||||
|
||||
out.write(format("%s%n", "[main]"));
|
||||
for (Entry<CardPrinted, Integer> e : d.getMain()) {
|
||||
|
||||
Reference in New Issue
Block a user