Unverified Commit 1e342137 authored by Mathieu Féry (Mathius)'s avatar Mathieu Féry (Mathius)
Browse files

Add name propertie inside DndSheet from donjon.bin.sh

parent 51fab3f7
......@@ -24,6 +24,7 @@ import java.util.concurrent.Future;
import fr.iutnantes.miar.dndgenerator.api.dnd.models.DnDSavesDB;
import fr.iutnantes.miar.dndgenerator.api.dnd.models.DnDSheetDB;
import fr.iutnantes.miar.dndgenerator.api.donjon.bin.sh.Name;
import fr.iutnantes.miar.dndgenerator.api.tenor.GIFObject;
import fr.iutnantes.miar.dndgenerator.api.tenor.TenorArgs;
import fr.iutnantes.miar.dndgenerator.api.tenor.models.GIFArtifactDB;
......@@ -60,6 +61,7 @@ public class DnDSheet implements Serializable {
protected GIFObject gif;
public final String searchGIF;
public final TenorArgs tenorArgs;
public final String name;
/**
* Basic Constructor for create sheet if all arguments are provided.
* @param hp : Integer represent hp of this character
......@@ -77,6 +79,7 @@ public class DnDSheet implements Serializable {
* @param attr : DnDAttrs represent attributes of this character
* @param skills : DnDSkills represent all skills of this character
* @param gifObject : GIFObject represent a Media associated to this character
* @param name : String represent name of this sheet
*/
public DnDSheet(@Nullable Integer hp, @Nullable Integer thac9, @Nullable Integer ac,
@Nullable String appearance, @NonNull DnDClass caracterClass,
......@@ -84,7 +87,8 @@ public class DnDSheet implements Serializable {
@NonNull List<String> languages, @NonNull List<String> equipment,
@NonNull List<String> notes, @NonNull List<String> spells,
@NonNull DnDSaves saves, @NonNull DnDAttrs attr,
@NonNull DnDSkills skills, @NonNull GIFObject gifObject) {
@NonNull DnDSkills skills, @NonNull GIFObject gifObject,
@NonNull String name) {
this.hp = hp != null && hp != -1 ? hp : null;
this.thac9 = thac9 != null && thac9 != -1 ? thac9 : null;
this.ac = ac != null && ac != -1 ? ac : null;
......@@ -103,6 +107,7 @@ public class DnDSheet implements Serializable {
this.searchGIF = String.format("%s,%s,%s", this.caracterClass, this.appearance,
this.system);
this.tenorArgs = this.gif.tenorArgs;
this.name = name;
}
/**
* Basic Constructor for create sheet from Funkaoshi API.
......@@ -133,7 +138,8 @@ public class DnDSheet implements Serializable {
@NonNull TenorArgs tenorArgs) {
this(hp, thac9, ac, appearance, caracterClass, personality, system, languages, equipment,
notes, spells, saves, attr, skills, GIFObject.getGIFObject(ctx, String.format(
"%s,%s,%s", caracterClass, appearance, system), tenorArgs));
"%s,%s,%s", caracterClass, appearance, system), tenorArgs),
Name.getRandomName(ctx, appearance));
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment