Adds card and binder export and import.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package com.majinnaibu.monstercards.models;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BinderExport {
|
||||
@SerializedName("schemaVersion")
|
||||
public int schemaVersion = 1;
|
||||
|
||||
@SerializedName("collections")
|
||||
public List<CollectionExport> collections = new ArrayList<>();
|
||||
|
||||
public static class CollectionExport {
|
||||
@SerializedName("name")
|
||||
public String name;
|
||||
|
||||
@SerializedName("cards")
|
||||
public List<Monster> cards = new ArrayList<>();
|
||||
|
||||
public CollectionExport() {
|
||||
}
|
||||
|
||||
public CollectionExport(String name, List<Monster> cards) {
|
||||
this.name = name != null ? name : "";
|
||||
this.cards = cards != null ? cards : new ArrayList<>();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.room.ColumnInfo;
|
||||
import androidx.room.Entity;
|
||||
import androidx.room.Ignore;
|
||||
import androidx.room.PrimaryKey;
|
||||
|
||||
import com.majinnaibu.monstercards.data.enums.AbilityScore;
|
||||
@@ -29,6 +30,9 @@ import java.util.UUID;
|
||||
@SuppressWarnings("unused")
|
||||
public class Monster {
|
||||
|
||||
@Ignore
|
||||
public int schemaVersion = 1;
|
||||
|
||||
@PrimaryKey
|
||||
@NonNull
|
||||
public UUID id;
|
||||
|
||||
Reference in New Issue
Block a user