-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbility.java
48 lines (38 loc) · 1.15 KB
/
Ability.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.example.roguecraftplugin;
public class Ability {
private String name;
private String description;
private int maxLevel;
public Ability(String name, String description, int maxLevel) {
this.name = name;
this.description = description;
this.maxLevel = maxLevel;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public int getMaxLevel() {
return maxLevel;
}
}
public class AbilityManager {
private Map<String, Ability> abilityMap;
public AbilityManager() {
abilityMap = new HashMap<>();
registerAbilities();
}
private void registerAbilities() {
registerAbility(new Ability("Cleave", "Deals additional damage in a frontal cone", 5));
registerAbility(new Ability("Whirlwind", "Spin and strike nearby enemies", 3));
// Register more abilities here
}
public void registerAbility(Ability ability) {
abilityMap.put(ability.getName(), ability);
}
public Ability getAbility(String abilityName) {
return abilityMap.get(abilityName);
}
}