Compare commits
5 Commits
87ef892fef
...
4741478623
| Author | SHA1 | Date | |
|---|---|---|---|
| 4741478623 | |||
| c144ff3b09 | |||
| edc18f6ba2 | |||
| 0c3a049558 | |||
| 85fffe5c98 |
2
Android/.idea/compiler.xml
generated
2
Android/.idea/compiler.xml
generated
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<bytecodeTargetLevel target="16" />
|
||||
<bytecodeTargetLevel target="15" />
|
||||
</component>
|
||||
</project>
|
||||
2
Android/.idea/gradle.xml
generated
2
Android/.idea/gradle.xml
generated
@@ -7,7 +7,7 @@
|
||||
<option name="testRunner" value="GRADLE" />
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="gradleJvm" value="Android Studio java home" />
|
||||
<option name="gradleJvm" value="openjdk-15" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
|
||||
2
Android/.idea/misc.xml
generated
2
Android/.idea/misc.xml
generated
@@ -44,7 +44,7 @@
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_15" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
id 'androidx.navigation.safeargs'
|
||||
id 'kotlin-android'
|
||||
}
|
||||
|
||||
Properties properties = new Properties()
|
||||
@@ -65,6 +66,8 @@ dependencies {
|
||||
// Included libs
|
||||
implementation fileTree(dir: "libs", include: ["*.jar"])
|
||||
|
||||
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.20"
|
||||
|
||||
// Google
|
||||
implementation 'androidx.appcompat:appcompat:1.3.1'
|
||||
implementation 'com.google.android.material:material:1.4.0'
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
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.room.TypeConverter
|
||||
import com.majinnaibu.monstercards.data.enums.ArmorType
|
||||
import com.majinnaibu.monstercards.data.enums.ArmorType.Companion.valueOfString
|
||||
|
||||
object ArmorTypeConverter {
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun fromArmorType(armorType: ArmorType): String {
|
||||
return armorType.stringValue
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun armorTypeFromStringValue(stringValue: String?): ArmorType {
|
||||
return valueOfString(stringValue!!)
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
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,19 @@
|
||||
package com.majinnaibu.monstercards.data.converters
|
||||
|
||||
import androidx.room.TypeConverter
|
||||
import com.majinnaibu.monstercards.data.enums.ChallengeRating
|
||||
import com.majinnaibu.monstercards.data.enums.ChallengeRating.Companion.valueOfString
|
||||
|
||||
object ChallengeRatingConverter {
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun fromChallengeRating(challengeRating: ChallengeRating): String {
|
||||
return challengeRating.stringValue
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun challengeRatingFromStringValue(stringValue: String?): ChallengeRating {
|
||||
return valueOfString(stringValue!!)
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
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,24 @@
|
||||
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.util.*
|
||||
|
||||
object ListOfTraitsConverter {
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun fromListOfTraits(traits: List<Trait?>?): String {
|
||||
val gson = Gson()
|
||||
return gson.toJson(traits)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun listOfTraitsFromString(string: String?): List<Trait> {
|
||||
val gson = Gson()
|
||||
val setType = object : TypeToken<ArrayList<Trait?>?>() {}.type
|
||||
return gson.fromJson(string, setType)
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
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,24 @@
|
||||
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.util.*
|
||||
|
||||
object SetOfLanguageConverter {
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun fromSetOfLanguage(languages: Set<Language?>?): String {
|
||||
val gson = Gson()
|
||||
return gson.toJson(languages)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun setOfLanguageFromString(string: String?): Set<Language> {
|
||||
val gson = Gson()
|
||||
val setType = object : TypeToken<HashSet<Language?>?>() {}.type
|
||||
return gson.fromJson(string, setType)
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
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,24 @@
|
||||
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.util.*
|
||||
|
||||
object SetOfSkillConverter {
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun fromSetOfSkill(skills: Set<Skill?>?): String {
|
||||
val gson = Gson()
|
||||
return gson.toJson(skills)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun setOfSkillFromString(string: String?): Set<Skill> {
|
||||
val gson = Gson()
|
||||
val setType = object : TypeToken<HashSet<Skill?>?>() {}.type
|
||||
return gson.fromJson(string, setType)
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
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,23 @@
|
||||
package com.majinnaibu.monstercards.data.converters
|
||||
|
||||
import androidx.room.TypeConverter
|
||||
import com.google.gson.Gson
|
||||
import com.google.gson.reflect.TypeToken
|
||||
import java.util.*
|
||||
|
||||
object SetOfStringConverter {
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun fromSetOfString(strings: Set<String?>?): String {
|
||||
val gson = Gson()
|
||||
return gson.toJson(strings)
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun setOfStringFromString(string: String?): Set<String> {
|
||||
val gson = Gson()
|
||||
val setType = object : TypeToken<HashSet<String?>?>() {}.type
|
||||
return gson.fromJson(string, setType)
|
||||
}
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
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,18 @@
|
||||
package com.majinnaibu.monstercards.data.converters
|
||||
|
||||
import androidx.room.TypeConverter
|
||||
import java.util.*
|
||||
|
||||
object UUIDConverter {
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun fromUUID(uuid: UUID): String {
|
||||
return uuid.toString()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
@TypeConverter
|
||||
fun uuidFromString(string: String?): UUID {
|
||||
return UUID.fromString(string)
|
||||
}
|
||||
}
|
||||
@@ -1,31 +0,0 @@
|
||||
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,26 @@
|
||||
package com.majinnaibu.monstercards.data.enums
|
||||
|
||||
enum class AbilityScore(
|
||||
@JvmField val stringValue: String,
|
||||
@JvmField val displayName: String,
|
||||
@JvmField val shortDisplayName: String
|
||||
) {
|
||||
STRENGTH("strength", "Strength", "STR"),
|
||||
DEXTERITY("dexterity", "Dexterity", "DEX"),
|
||||
CONSTITUTION("constitution", "Constitution", "CON"),
|
||||
INTELLIGENCE("intelligence", "Intelligence", "INT"),
|
||||
WISDOM("wisdom", "Wisdom", "WIS"),
|
||||
CHARISMA("charisma", "Charisma", "CHA");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun valueOfString(string: String): AbilityScore {
|
||||
for (abilityScore in values()) {
|
||||
if (abilityScore.stringValue == string) {
|
||||
return abilityScore
|
||||
}
|
||||
}
|
||||
return STRENGTH
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
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,23 @@
|
||||
package com.majinnaibu.monstercards.data.enums
|
||||
|
||||
enum class AdvantageType(
|
||||
val stringValue: String,
|
||||
val displayName: String,
|
||||
@JvmField val label: String
|
||||
) {
|
||||
NONE("none", "None", ""),
|
||||
ADVANTAGE("advantage", "Advantage", "A"),
|
||||
DISADVANTAGE("disadvantage", "Disadvantage", "D");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun valueOfString(string: String): AdvantageType {
|
||||
for (advantageType in values()) {
|
||||
if (advantageType.stringValue == string) {
|
||||
return advantageType
|
||||
}
|
||||
}
|
||||
return NONE
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
package com.majinnaibu.monstercards.data.enums
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public enum ArmorType {
|
||||
enum class ArmorType(
|
||||
@JvmField val stringValue: String,
|
||||
@JvmField val displayName: String,
|
||||
@JvmField val baseArmorClass: Int
|
||||
) {
|
||||
NONE("none", "None", 10),
|
||||
NATURAL_ARMOR("natural armor", "Natural Armor", 10),
|
||||
MAGE_ARMOR("mage armor", "Mage Armor", 10),
|
||||
@@ -17,25 +20,17 @@ public enum ArmorType {
|
||||
CHAIN_MAIL("chain mail", "Chain Mail", 16),
|
||||
SPLINT_MAIL("splint", "Splint Mail", 17),
|
||||
PLATE_MAIL("plate", "Plate Mail", 18),
|
||||
OTHER("other", "Other", 10),
|
||||
;
|
||||
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;
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun valueOfString(string: String): ArmorType {
|
||||
for (armorType in values()) {
|
||||
if (armorType.stringValue == string) {
|
||||
return armorType
|
||||
}
|
||||
}
|
||||
return NONE
|
||||
}
|
||||
return ArmorType.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
package com.majinnaibu.monstercards.data.enums
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public enum ChallengeRating {
|
||||
enum class ChallengeRating(
|
||||
@JvmField val stringValue: String,
|
||||
@JvmField val displayName: String,
|
||||
@JvmField val proficiencyBonus: Int
|
||||
) {
|
||||
CUSTOM("custom", "Custom", 0),
|
||||
ZERO("zero", "0 (10 XP)", 2),
|
||||
ONE_EIGHTH("1/8", "1/8 (25 XP)", 2),
|
||||
@@ -36,25 +39,17 @@ public enum ChallengeRating {
|
||||
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),
|
||||
;
|
||||
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;
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun valueOfString(string: String): ChallengeRating {
|
||||
for (challengeRating in values()) {
|
||||
if (challengeRating.stringValue == string) {
|
||||
return challengeRating
|
||||
}
|
||||
}
|
||||
return ONE
|
||||
}
|
||||
return ChallengeRating.ONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
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,23 @@
|
||||
package com.majinnaibu.monstercards.data.enums
|
||||
|
||||
enum class ProficiencyType(
|
||||
@JvmField val stringValue: String,
|
||||
@JvmField val displayName: String,
|
||||
@JvmField val label: String
|
||||
) {
|
||||
NONE("none", "None", ""),
|
||||
PROFICIENT("proficient", "Proficient", "P"),
|
||||
EXPERTISE("expertise", "Expertise", "Ex");
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
fun valueOfString(string: String): ProficiencyType {
|
||||
for (proficiencyType in values()) {
|
||||
if (proficiencyType.stringValue == string) {
|
||||
return proficiencyType
|
||||
}
|
||||
}
|
||||
return NONE
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
package com.majinnaibu.monstercards.data.enums
|
||||
|
||||
public enum StringType {
|
||||
enum class StringType {
|
||||
CONDITION_IMMUNITY,
|
||||
DAMAGE_IMMUNITY,
|
||||
DAMAGE_RESISTANCE,
|
||||
DAMAGE_VULNERABILITY,
|
||||
SENSE
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.majinnaibu.monstercards.data.enums;
|
||||
package com.majinnaibu.monstercards.data.enums
|
||||
|
||||
public enum TraitType {
|
||||
enum class TraitType {
|
||||
ABILITY,
|
||||
ACTION,
|
||||
LAIR_ACTION,
|
||||
LEGENDARY_ACTION,
|
||||
REGIONAL_ACTION,
|
||||
REACTIONS
|
||||
}
|
||||
}
|
||||
@@ -5,8 +5,9 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "com.android.tools.build:gradle:7.0.1"
|
||||
classpath 'com.android.tools.build:gradle:7.0.4'
|
||||
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.3.5"
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
Reference in New Issue
Block a user