Merge commit 'd1e3c3f5f313057e5a81a4333906ef5d79adea83' as 'Android'
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
package com.majinnaibu.monstercards.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.majinnaibu.monstercards.data.enums.AbilityScore;
|
||||
import com.majinnaibu.monstercards.data.enums.AdvantageType;
|
||||
import com.majinnaibu.monstercards.data.enums.ArmorType;
|
||||
import com.majinnaibu.monstercards.data.enums.ChallengeRating;
|
||||
import com.majinnaibu.monstercards.data.enums.ProficiencyType;
|
||||
import com.majinnaibu.monstercards.models.Language;
|
||||
import com.majinnaibu.monstercards.models.Monster;
|
||||
import com.majinnaibu.monstercards.models.Skill;
|
||||
import com.majinnaibu.monstercards.models.Trait;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public final class DevContent {
|
||||
@NonNull
|
||||
public static Monster createSampleMonster() {
|
||||
Monster monster = new Monster();
|
||||
// Name
|
||||
monster.name = "Pixie";
|
||||
// Meta
|
||||
monster.size = "tiny";
|
||||
monster.type = "fey";
|
||||
monster.subtype = "";
|
||||
monster.alignment = "neutral good";
|
||||
monster.armorType = ArmorType.NONE;
|
||||
// Armor & Armor Class
|
||||
monster.shieldBonus = 0;
|
||||
monster.naturalArmorBonus = 7;
|
||||
monster.otherArmorDescription = "14";
|
||||
// Hit Points
|
||||
monster.hitDice = 1;
|
||||
monster.hasCustomHP = false;
|
||||
monster.customHPDescription = "11 (2d8 + 2)";
|
||||
monster.walkSpeed = 10;
|
||||
monster.burrowSpeed = 0;
|
||||
monster.climbSpeed = 0;
|
||||
monster.flySpeed = 30;
|
||||
monster.canHover = false;
|
||||
monster.swimSpeed = 0;
|
||||
monster.hasCustomSpeed = false;
|
||||
monster.customSpeedDescription = "30 ft., swim 30 ft.";
|
||||
// Ability Scores
|
||||
monster.strengthScore = Integer.parseInt("2");
|
||||
monster.dexterityScore = Integer.parseInt("20");
|
||||
monster.constitutionScore = Integer.parseInt("8");
|
||||
monster.intelligenceScore = Integer.parseInt("10");
|
||||
monster.wisdomScore = Integer.parseInt("14");
|
||||
monster.charismaScore = Integer.parseInt("15");
|
||||
// monster.strengthScore = 10;
|
||||
// monster.dexterityScore = 10;
|
||||
// monster.constitutionScore = 10;
|
||||
// monster.intelligenceScore = 10;
|
||||
// monster.wisdomScore = 10;
|
||||
// monster.charismaScore = 10;
|
||||
|
||||
// Saving Throws
|
||||
monster.strengthSavingThrowAdvantage = AdvantageType.NONE;
|
||||
monster.strengthSavingThrowProficiency = ProficiencyType.NONE;
|
||||
monster.dexteritySavingThrowAdvantage = AdvantageType.ADVANTAGE;
|
||||
monster.dexteritySavingThrowProficiency = ProficiencyType.PROFICIENT;
|
||||
monster.constitutionSavingThrowAdvantage = AdvantageType.DISADVANTAGE;
|
||||
monster.constitutionSavingThrowProficiency = ProficiencyType.EXPERTISE;
|
||||
monster.intelligenceSavingThrowAdvantage = AdvantageType.NONE;
|
||||
monster.intelligenceSavingThrowProficiency = ProficiencyType.EXPERTISE;
|
||||
monster.wisdomSavingThrowAdvantage = AdvantageType.ADVANTAGE;
|
||||
monster.wisdomSavingThrowProficiency = ProficiencyType.PROFICIENT;
|
||||
monster.charismaSavingThrowAdvantage = AdvantageType.DISADVANTAGE;
|
||||
monster.charismaSavingThrowProficiency = ProficiencyType.NONE;
|
||||
//Skills
|
||||
monster.skills.add(new Skill("perception", AbilityScore.WISDOM));
|
||||
monster.skills.add(new Skill("stealth", AbilityScore.DEXTERITY));
|
||||
// Damage Types
|
||||
monster.damageImmunities.add("force");
|
||||
monster.damageImmunities.add("lightning");
|
||||
monster.damageImmunities.add("poison");
|
||||
monster.damageResistances.add("cold");
|
||||
monster.damageResistances.add("fire");
|
||||
monster.damageResistances.add("piercing");
|
||||
monster.damageVulnerabilities.add("acid");
|
||||
monster.damageVulnerabilities.add("bludgeoning");
|
||||
monster.damageVulnerabilities.add("necrotic");
|
||||
// Condition Immunities
|
||||
monster.conditionImmunities.add("blinded");
|
||||
// Senses
|
||||
monster.senses.add("blindsight 10 ft. (blind beyond this range)");
|
||||
monster.senses.add("darkvision 20 ft.");
|
||||
monster.senses.add("tremorsense 30 ft.");
|
||||
monster.senses.add("truesight 40 ft.");
|
||||
monster.telepathyRange = 20;
|
||||
monster.understandsButDescription = "doesn't care";
|
||||
// Languages
|
||||
monster.languages.add(new Language("English", true));
|
||||
monster.languages.add(new Language("Steve", false));
|
||||
monster.languages.add(new Language("Spanish", true));
|
||||
monster.languages.add(new Language("French", true));
|
||||
monster.languages.add(new Language("Mermataur", false));
|
||||
monster.languages.add(new Language("Goldfish", false));
|
||||
// Challenge Rating
|
||||
monster.challengeRating = ChallengeRating.CUSTOM;
|
||||
monster.customChallengeRatingDescription = "Infinite (0XP)";
|
||||
monster.customProficiencyBonus = 4;
|
||||
// Abilities
|
||||
monster.abilities.add(new Trait("Spellcasting", "The acolyte is a 1st-level spellcaster. Its spellcasting ability is Wisdom (spell save DC [WIS SAVE], [WIS ATK] to hit with spell attacks). The acolyte has following cleric spells prepared:\n\n\n> Cantrips (at will): _light, sacred flame, thaumaturgy_\n> 1st level (3 slots): _bless, cure wounds, sanctuary_"));
|
||||
monster.abilities.add(new Trait("Amphibious", "The dragon can breathe air and water."));
|
||||
monster.abilities.add(new Trait("Legendary Resistance (3/Day)", "If the dragon fails a saving throw, it can choose to succeed instead."));
|
||||
// Actions
|
||||
monster.actions.add(new Trait("Club", "_Melee Weapon Attack:_ [STR ATK] to hit, reach 5 ft., one target. _Hit:_ 2 (1d4) bludgeoning damage."));
|
||||
|
||||
return monster;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.majinnaibu.monstercards.data;
|
||||
|
||||
|
||||
import androidx.room.Dao;
|
||||
import androidx.room.Delete;
|
||||
import androidx.room.Insert;
|
||||
import androidx.room.OnConflictStrategy;
|
||||
import androidx.room.Query;
|
||||
|
||||
import com.majinnaibu.monstercards.models.Monster;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.rxjava3.core.Completable;
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
|
||||
@Dao
|
||||
public interface MonsterDAO {
|
||||
@Query("SELECT * FROM monsters")
|
||||
Flowable<List<Monster>> getAll();
|
||||
|
||||
@Query("SELECT * FROM monsters WHERE id IN (:monsterIds)")
|
||||
Flowable<List<Monster>> loadAllByIds(String[] monsterIds);
|
||||
|
||||
@Query("SELECT * FROM monsters WHERE name LIKE :name LIMIT 1")
|
||||
Flowable<Monster> findByName(String name);
|
||||
|
||||
@Query("SELECT monsters.* FROM monsters JOIN monsters_fts ON monsters.oid = monsters_fts.docid WHERE monsters_fts MATCH :searchText")
|
||||
Flowable<List<Monster>> search(String searchText);
|
||||
|
||||
@Insert
|
||||
Completable insertAll(Monster... monsters);
|
||||
|
||||
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
||||
Completable save(Monster... monsters);
|
||||
|
||||
@Delete
|
||||
Completable delete(Monster monster);
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
package com.majinnaibu.monstercards.data;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.majinnaibu.monstercards.AppDatabase;
|
||||
import com.majinnaibu.monstercards.helpers.StringHelper;
|
||||
import com.majinnaibu.monstercards.models.Monster;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.rxjava3.core.Completable;
|
||||
import io.reactivex.rxjava3.core.Flowable;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
public class MonsterRepository {
|
||||
|
||||
private final AppDatabase m_db;
|
||||
|
||||
public MonsterRepository(@NonNull AppDatabase db) {
|
||||
m_db = db;
|
||||
}
|
||||
|
||||
public Flowable<List<Monster>> getMonsters() {
|
||||
return m_db.monsterDAO()
|
||||
.getAll()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Flowable<List<Monster>> searchMonsters(String searchText) {
|
||||
return m_db.monsterDAO()
|
||||
.getAll()
|
||||
.map(monsters -> {
|
||||
ArrayList<Monster> filteredMonsters = new ArrayList<>();
|
||||
for (Monster monster : monsters) {
|
||||
if (Helpers.monsterMatchesSearch(monster, searchText)) {
|
||||
filteredMonsters.add(monster);
|
||||
}
|
||||
}
|
||||
return (List<Monster>) filteredMonsters;
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Flowable<Monster> getMonster(@NonNull UUID monsterId) {
|
||||
return m_db.monsterDAO()
|
||||
.loadAllByIds(new String[]{monsterId.toString()})
|
||||
.map(
|
||||
monsters -> {
|
||||
if (monsters.size() > 0) {
|
||||
return monsters.get(0);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread());
|
||||
}
|
||||
|
||||
public Completable addMonster(Monster monster) {
|
||||
Completable result = m_db.monsterDAO().insertAll(monster);
|
||||
result.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Completable deleteMonster(Monster monster) {
|
||||
Completable result = m_db.monsterDAO().delete(monster);
|
||||
result.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
|
||||
return result;
|
||||
}
|
||||
|
||||
public Completable saveMonster(Monster monster) {
|
||||
Completable result = m_db.monsterDAO().save(monster);
|
||||
result.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
|
||||
return result;
|
||||
}
|
||||
|
||||
private static class Helpers {
|
||||
static boolean monsterMatchesSearch(Monster monster, String searchText) {
|
||||
if (StringHelper.isNullOrEmpty(searchText)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (StringHelper.containsCaseInsensitive(monster.name, searchText)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (StringHelper.containsCaseInsensitive(monster.size, searchText)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (StringHelper.containsCaseInsensitive(monster.type, searchText)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (StringHelper.containsCaseInsensitive(monster.subtype, searchText)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (StringHelper.containsCaseInsensitive(monster.alignment, searchText)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.majinnaibu.monstercards.data.converters;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.TypeConverter;
|
||||
|
||||
import com.majinnaibu.monstercards.data.enums.ArmorType;
|
||||
|
||||
public class ArmorTypeConverter {
|
||||
|
||||
@TypeConverter
|
||||
public static String fromArmorType(@NonNull ArmorType armorType) {
|
||||
return armorType.stringValue;
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static ArmorType armorTypeFromStringValue(String stringValue) {
|
||||
return ArmorType.valueOfString(stringValue);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.majinnaibu.monstercards.data.converters;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.TypeConverter;
|
||||
|
||||
import com.majinnaibu.monstercards.data.enums.ChallengeRating;
|
||||
|
||||
public class ChallengeRatingConverter {
|
||||
|
||||
@TypeConverter
|
||||
public static String fromChallengeRating(@NonNull ChallengeRating challengeRating) {
|
||||
return challengeRating.stringValue;
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static ChallengeRating challengeRatingFromStringValue(String stringValue) {
|
||||
return ChallengeRating.valueOfString(stringValue);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.majinnaibu.monstercards.data.converters;
|
||||
|
||||
import androidx.room.TypeConverter;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.majinnaibu.monstercards.models.Trait;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ListOfTraitsConverter {
|
||||
@TypeConverter
|
||||
public static String fromListOfTraits(List<Trait> traits) {
|
||||
Gson gson = new Gson();
|
||||
return gson.toJson(traits);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static List<Trait> listOfTraitsFromString(String string) {
|
||||
Gson gson = new Gson();
|
||||
Type setType = new TypeToken<ArrayList<Trait>>() {
|
||||
}.getType();
|
||||
return gson.fromJson(string, setType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.majinnaibu.monstercards.data.converters;
|
||||
|
||||
import androidx.room.TypeConverter;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.majinnaibu.monstercards.models.Language;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class SetOfLanguageConverter {
|
||||
|
||||
@TypeConverter
|
||||
public static String fromSetOfLanguage(Set<Language> languages) {
|
||||
Gson gson = new Gson();
|
||||
return gson.toJson(languages);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static Set<Language> setOfLanguageFromString(String string) {
|
||||
Gson gson = new Gson();
|
||||
Type setType = new TypeToken<HashSet<Language>>() {
|
||||
}.getType();
|
||||
return gson.fromJson(string, setType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.majinnaibu.monstercards.data.converters;
|
||||
|
||||
import androidx.room.TypeConverter;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.majinnaibu.monstercards.models.Skill;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class SetOfSkillConverter {
|
||||
|
||||
@TypeConverter
|
||||
public static String fromSetOfSkill(Set<Skill> skills) {
|
||||
Gson gson = new Gson();
|
||||
return gson.toJson(skills);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static Set<Skill> setOfSkillFromString(String string) {
|
||||
Gson gson = new Gson();
|
||||
Type setType = new TypeToken<HashSet<Skill>>() {
|
||||
}.getType();
|
||||
return gson.fromJson(string, setType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.majinnaibu.monstercards.data.converters;
|
||||
|
||||
import androidx.room.TypeConverter;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public class SetOfStringConverter {
|
||||
|
||||
@TypeConverter
|
||||
public static String fromSetOfString(Set<String> strings) {
|
||||
Gson gson = new Gson();
|
||||
return gson.toJson(strings);
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static Set<String> setOfStringFromString(String string) {
|
||||
Gson gson = new Gson();
|
||||
Type setType = new TypeToken<HashSet<String>>() {
|
||||
}.getType();
|
||||
return gson.fromJson(string, setType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.majinnaibu.monstercards.data.converters;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.room.TypeConverter;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class UUIDConverter {
|
||||
|
||||
@NonNull
|
||||
@TypeConverter
|
||||
public static String fromUUID(@NonNull UUID uuid) {
|
||||
return uuid.toString();
|
||||
}
|
||||
|
||||
@TypeConverter
|
||||
public static UUID uuidFromString(String string) {
|
||||
return UUID.fromString(string);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public enum AbilityScore {
|
||||
STRENGTH("strength", "Strength", "STR"),
|
||||
DEXTERITY("dexterity", "Dexterity", "DEX"),
|
||||
CONSTITUTION("constitution", "Constitution", "CON"),
|
||||
INTELLIGENCE("intelligence", "Intelligence", "INT"),
|
||||
WISDOM("wisdom", "Wisdom", "WIS"),
|
||||
CHARISMA("charisma", "Charisma", "CHA"),
|
||||
;
|
||||
|
||||
public final String displayName;
|
||||
public final String shortDisplayName;
|
||||
public final String stringValue;
|
||||
|
||||
AbilityScore(String stringValue, String displayName, String shortDisplayName) {
|
||||
this.displayName = displayName;
|
||||
this.stringValue = stringValue;
|
||||
this.shortDisplayName = shortDisplayName;
|
||||
}
|
||||
|
||||
public static AbilityScore valueOfString(String string) {
|
||||
for (AbilityScore abilityScore : values()) {
|
||||
if (abilityScore.stringValue.equals(string)) {
|
||||
return abilityScore;
|
||||
}
|
||||
}
|
||||
return AbilityScore.STRENGTH;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
|
||||
public enum AdvantageType {
|
||||
NONE("none", "None", ""),
|
||||
ADVANTAGE("advantage", "Advantage", "A"),
|
||||
DISADVANTAGE("disadvantage", "Disadvantage", "D"),
|
||||
;
|
||||
|
||||
public final String displayName;
|
||||
public final String stringValue;
|
||||
public final String label;
|
||||
|
||||
AdvantageType(String stringValue, String displayName, String label) {
|
||||
this.displayName = displayName;
|
||||
this.stringValue = stringValue;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public static AdvantageType valueOfString(String string) {
|
||||
for (AdvantageType advantageType : values()) {
|
||||
if (advantageType.stringValue.equals(string)) {
|
||||
return advantageType;
|
||||
}
|
||||
}
|
||||
return AdvantageType.NONE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public enum ArmorType {
|
||||
NONE("none", "None", 10),
|
||||
NATURAL_ARMOR("natural armor", "Natural Armor", 10),
|
||||
MAGE_ARMOR("mage armor", "Mage Armor", 10),
|
||||
PADDED("padded", "Padded", 11),
|
||||
LEATHER("leather", "Leather", 11),
|
||||
STUDDED_LEATHER("studded", "Studded Leather", 12),
|
||||
HIDE("hide", "Hide", 12),
|
||||
CHAIN_SHIRT("chain shirt", "Chain Shirt", 13),
|
||||
SCALE_MAIL("scale mail", "Scale Mail", 14),
|
||||
BREASTPLATE("breastplate", "Breastplate", 14),
|
||||
HALF_PLATE("half plate", "Half Plate", 15),
|
||||
RING_MAIL("ring mail", "Ring Mail", 14),
|
||||
CHAIN_MAIL("chain mail", "Chain Mail", 16),
|
||||
SPLINT_MAIL("splint", "Splint Mail", 17),
|
||||
PLATE_MAIL("plate", "Plate Mail", 18),
|
||||
OTHER("other", "Other", 10),
|
||||
;
|
||||
|
||||
public final String displayName;
|
||||
public final String stringValue;
|
||||
public final int baseArmorClass;
|
||||
|
||||
ArmorType(String stringValue, String displayName, int baseArmorClass) {
|
||||
this.displayName = displayName;
|
||||
this.stringValue = stringValue;
|
||||
this.baseArmorClass = baseArmorClass;
|
||||
}
|
||||
|
||||
public static ArmorType valueOfString(String string) {
|
||||
for (ArmorType armorType : values()) {
|
||||
if (armorType.stringValue.equals(string)) {
|
||||
return armorType;
|
||||
}
|
||||
}
|
||||
return ArmorType.NONE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public enum ChallengeRating {
|
||||
CUSTOM("custom", "Custom", 0),
|
||||
ZERO("zero", "0 (10 XP)", 2),
|
||||
ONE_EIGHTH("1/8", "1/8 (25 XP)", 2),
|
||||
ONE_QUARTER("1/4", "1/4 (50 XP)", 2),
|
||||
ONE_HALF("1/2", "1/2 (100 XP)", 2),
|
||||
ONE("1", "1 (200 XP)", 2),
|
||||
TWO("2", "2 (450 XP)", 2),
|
||||
THREE("3", "3 (700 XP)", 2),
|
||||
FOUR("4", "4 (1,100 XP)", 2),
|
||||
FIVE("5", "5 (1,800 XP)", 3),
|
||||
SIX("6", "6 (2,300 XP)", 3),
|
||||
SEVEN("7", "7 (2,900 XP)", 3),
|
||||
EIGHT("8", "8 (3,900 XP)", 3),
|
||||
NINE("9", "9 (5,000 XP)", 4),
|
||||
TEN("10", "10 (5,900 XP)", 4),
|
||||
ELEVEN("11", "11 (7,200 XP)", 4),
|
||||
TWELVE("12", "12 (8,400 XP)", 4),
|
||||
THIRTEEN("13", "13 (10,000 XP)", 5),
|
||||
FOURTEEN("14", "14 (11,500 XP)", 5),
|
||||
FIFTEEN("15", "15 (13,000 XP)", 5),
|
||||
SIXTEEN("16", "16 (15,000 XP)", 5),
|
||||
SEVENTEEN("17", "17 (18,000 XP)", 6),
|
||||
EIGHTEEN("18", "18 (20,000 XP)", 6),
|
||||
NINETEEN("19", "19 (22,000 XP)", 6),
|
||||
TWENTY("20", "20 (25,000 XP)", 6),
|
||||
TWENTY_ONE("21", "21 (33,000 XP)", 7),
|
||||
TWENTY_TWO("22", "22 (41,000 XP)", 7),
|
||||
TWENTY_THREE("23", "23 (50,000 XP)", 7),
|
||||
TWENTY_FOUR("24", "24 (62,000 XP)", 7),
|
||||
TWENTY_FIVE("25", "25 (75,000 XP)", 8),
|
||||
TWENTY_SIX("26", "26 (90,000 XP)", 8),
|
||||
TWENTY_SEVEN("27", "27 (105,000 XP)", 8),
|
||||
TWENTY_EIGHT("28", "28 (120,000 XP)", 8),
|
||||
TWENTY_NINE("29", "29 (135,000 XP)", 9),
|
||||
THIRTY("30", "30 (155,000 XP)", 9),
|
||||
;
|
||||
|
||||
public final String displayName;
|
||||
public final String stringValue;
|
||||
public final int proficiencyBonus;
|
||||
|
||||
ChallengeRating(String stringValue, String displayName, int proficiencyBonus) {
|
||||
this.displayName = displayName;
|
||||
this.stringValue = stringValue;
|
||||
this.proficiencyBonus = proficiencyBonus;
|
||||
}
|
||||
|
||||
public static ChallengeRating valueOfString(String string) {
|
||||
for (ChallengeRating challengeRating : values()) {
|
||||
if (challengeRating.stringValue.equals(string)) {
|
||||
return challengeRating;
|
||||
}
|
||||
}
|
||||
return ChallengeRating.ONE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
|
||||
public enum ProficiencyType {
|
||||
NONE("none", "None", ""),
|
||||
PROFICIENT("proficient", "Proficient", "P"),
|
||||
EXPERTISE("expertise", "Expertise", "Ex"),
|
||||
;
|
||||
|
||||
public final String displayName;
|
||||
public final String stringValue;
|
||||
public final String label;
|
||||
|
||||
ProficiencyType(String stringValue, String displayName, String label) {
|
||||
this.displayName = displayName;
|
||||
this.stringValue = stringValue;
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
public static ProficiencyType valueOfString(String string) {
|
||||
for (ProficiencyType proficiencyType : values()) {
|
||||
if (proficiencyType.stringValue.equals(string)) {
|
||||
return proficiencyType;
|
||||
}
|
||||
}
|
||||
return ProficiencyType.NONE;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
|
||||
public enum StringType {
|
||||
CONDITION_IMMUNITY,
|
||||
DAMAGE_IMMUNITY,
|
||||
DAMAGE_RESISTANCE,
|
||||
DAMAGE_VULNERABILITY,
|
||||
SENSE
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
|
||||
public enum TraitType {
|
||||
ABILITY,
|
||||
ACTION,
|
||||
LAIR_ACTION,
|
||||
LEGENDARY_ACTION,
|
||||
REGIONAL_ACTION,
|
||||
REACTIONS
|
||||
}
|
||||
Reference in New Issue
Block a user