-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass.java
51 lines (40 loc) · 1.38 KB
/
class.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
49
50
51
package com.example.roguecraftplugin;
import java.util.HashMap;
import java.util.Map;
public class CharacterClassManager {
private RoguecraftPlugin plugin;
private Map<String, CharacterClass> characterClasses;
public CharacterClassManager(RoguecraftPlugin plugin) {
this.plugin = plugin;
this.characterClasses = new HashMap<>();
}
public void registerCharacterClass(CharacterClass characterClass) {
characterClasses.put(characterClass.getName(), characterClass);
}
public CharacterClass getCharacterClass(String name) {
return characterClasses.get(name);
}
public void assignCharacterClass(Player player, CharacterClass characterClass) {
RoguecraftPlayerData playerData = plugin.getPlayerData(player);
playerData.setCharacterClass(characterClass);
}
}
public class CharacterClass {
private String name;
private String description;
private Map<Stat, Integer> statModifiers;
public CharacterClass(String name, String description, Map<Stat, Integer> statModifiers) {
this.name = name;
this.description = description;
this.statModifiers = statModifiers;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public Map<Stat, Integer> getStatModifiers() {
return statModifiers;
}
}