Adds actions to monster cards.
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package com.majinnaibu.monstercards.models;
|
||||
|
||||
public class Action {
|
||||
|
||||
public Action(String name, String description) {
|
||||
mName = name;
|
||||
mDescription = description;
|
||||
}
|
||||
|
||||
private String mName;
|
||||
public String getName() {
|
||||
return mName;
|
||||
}
|
||||
public void setName(String name) {
|
||||
mName = name;
|
||||
}
|
||||
|
||||
private String mDescription;
|
||||
public String getDescription() {
|
||||
return mDescription;
|
||||
}
|
||||
public void setDescription(String description) {
|
||||
mDescription = description;
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@ public class Monster {
|
||||
|
||||
public Monster() {
|
||||
mAbilities = new ArrayList<>();
|
||||
mActions = new ArrayList<>();
|
||||
mConditionImmunities = new HashSet<>();
|
||||
mDamageTypes = new HashSet<>();
|
||||
mLanguages = new HashSet<>();
|
||||
@@ -979,4 +980,26 @@ public class Monster {
|
||||
return getProficiencyBonus() + getAbilityModifier(abilityScoreName);
|
||||
}
|
||||
|
||||
public List<String> getActionDescriptions() {
|
||||
ArrayList<String> actions = new ArrayList<>();
|
||||
for (Action action : getActions()) {
|
||||
actions.add(getPlaceholderReplacedText(String.format("__%s__ %s", action.getName(), action.getDescription())));
|
||||
}
|
||||
return actions;
|
||||
}
|
||||
|
||||
private ArrayList<Action> mActions;
|
||||
public List<Action> getActions() {
|
||||
return mActions;
|
||||
}
|
||||
public void addAction(Action ability) {
|
||||
mActions.add(ability);
|
||||
}
|
||||
public void removeAction(Action ability) {
|
||||
mActions.remove(ability);
|
||||
}
|
||||
public void clearActions() {
|
||||
mActions.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user