Skip to content

Commit bfe49d8

Browse files
committed
Merge branch 'feat/gnome' into 'master'
Přidán gnóm jako hratelná rasa See merge request fmasa/pv239-project!90
2 parents 27efb91 + e4d7cb6 commit bfe49d8

File tree

5 files changed

+19
-8
lines changed

5 files changed

+19
-8
lines changed

app/src/main/java/cz/muni/fi/rpg/model/domain/character/Race.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ enum class Race {
77
HIGH_ELF,
88
DWARF,
99
WOOD_ELF,
10-
HALFLING;
10+
HALFLING,
11+
GNOME;
1112

1213
fun getReadableNameId(): Int {
1314
return when (this) {
@@ -16,6 +17,7 @@ enum class Race {
1617
DWARF -> R.string.race_dwarf
1718
HALFLING -> R.string.race_halfling
1819
WOOD_ELF -> R.string.race_wood_elf
20+
GNOME -> R.string.race_gnome
1921
}
2022
}
2123
}

app/src/main/java/cz/muni/fi/rpg/ui/characterCreation/CharacterInfoFormFragment.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,10 @@ class CharacterInfoFormFragment :
115115
when (character.getRace()) {
116116
Race.HUMAN -> radioButtonRaceHuman.isChecked = true
117117
Race.DWARF -> radioButtonRaceDwarf.isChecked = true
118-
Race.HIGH_ELF -> radioButtonRaceElf.isChecked = true
119-
Race.WOOD_ELF -> radioButtonRaceGnome.isChecked = true
118+
Race.HIGH_ELF -> radioButtonRaceHighElf.isChecked = true
119+
Race.WOOD_ELF -> radioButtonRaceWoodElf.isChecked = true
120120
Race.HALFLING -> radioButtonRaceHalfling.isChecked = true
121+
Race.GNOME -> radioButtonRaceGnome.isChecked = true
121122
}
122123
}
123124

@@ -129,9 +130,10 @@ class CharacterInfoFormFragment :
129130
val race: Race = when (radioGroup.checkedRadioButtonId) {
130131
R.id.radioButtonRaceHuman -> Race.HUMAN
131132
R.id.radioButtonRaceDwarf -> Race.DWARF
132-
R.id.radioButtonRaceElf -> Race.HIGH_ELF
133-
R.id.radioButtonRaceGnome -> Race.WOOD_ELF
133+
R.id.radioButtonRaceHighElf -> Race.HIGH_ELF
134+
R.id.radioButtonRaceWoodElf -> Race.WOOD_ELF
134135
R.id.radioButtonRaceHalfling -> Race.HALFLING
136+
R.id.radioButtonRaceGnome -> Race.GNOME
135137
else -> error("No race selected")
136138
}
137139

app/src/main/res/layout/fragment_character_info_form.xml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
android:text="@string/race_halfling" />
6565

6666
<RadioButton
67-
android:id="@+id/radioButtonRaceElf"
67+
android:id="@+id/radioButtonRaceHighElf"
6868
android:layout_width="match_parent"
6969
android:layout_height="wrap_content"
7070
android:text="@string/race_high_elf" />
@@ -76,10 +76,16 @@
7676
android:text="@string/race_dwarf" />
7777

7878
<RadioButton
79-
android:id="@+id/radioButtonRaceGnome"
79+
android:id="@+id/radioButtonRaceWoodElf"
8080
android:layout_width="match_parent"
8181
android:layout_height="wrap_content"
8282
android:text="@string/race_wood_elf" />
83+
84+
<RadioButton
85+
android:id="@+id/radioButtonRaceGnome"
86+
android:layout_width="match_parent"
87+
android:layout_height="wrap_content"
88+
android:text="@string/race_gnome" />
8389
</RadioGroup>
8490

8591
<cz.muni.fi.rpg.ui.views.TextInput

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
<string name="race_wood_elf">Wood Elf</string>
9595
<string name="race_halfling">Halfling</string>
9696
<string name="race_human">Human</string>
97+
<string name="race_gnome">Gnome</string>
9798
<string name="button_edit">Edit</string>
9899
<string name="subtitle_edit_character">Edit character</string>
99100
<string name="no_parties_prompt">Assemble your first party\n or join the existing one.</string>

firebase/firestore.rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ service cloud.firestore {
190190
&& character.motivation is string && character.motivation.size() <= 200
191191
&& character.mutation is string && character.mutation.size() <= 200
192192
&& character.socialClass is string && isNotBlank(character.socialClass) && character.socialClass.size() <= 50
193-
&& character.race is string && character.race in ["HUMAN", "HIGH_ELF", "DWARF", "HALFLING", "WOOD_ELF"]
193+
&& character.race is string && character.race in ["HUMAN", "HIGH_ELF", "DWARF", "HALFLING", "WOOD_ELF", "GNOME"]
194194
&& arePointsValid(character.points)
195195
&& areStatsValid(character.stats)
196196
&& areStatsValid(character.maxStats)

0 commit comments

Comments
 (0)