diff --git a/src/main/java/cactusServer/models/CharacterManager.java b/src/main/java/cactusServer/models/CharacterManager.java index 1c3126f..e850c20 100644 --- a/src/main/java/cactusServer/models/CharacterManager.java +++ b/src/main/java/cactusServer/models/CharacterManager.java @@ -5,8 +5,20 @@ import org.ntlab.radishforandroidstudio.framework.model3D.Model3D; public class CharacterManager { + private static CharacterManager theInstance = null; private HashMap characters = new HashMap<>(); + private CharacterManager() { + + } + + public static CharacterManager getInstance() { + if (theInstance == null) { + theInstance = new CharacterManager(); + } + return theInstance; + } + public Model3D getCharacter(int id) { return characters.get(id); }