Solved Best way of storing players?

Discussion in 'Plugin Development' started by dontjudgeme1243, Nov 12, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    dontjudgeme1243

    I know this isn't technically a bug, but I was thinking of making a minigame plugin and I need help with something. I have gotten a lot of ideas about how to store players on teams, but I couldn't come to a conclusion so I'm using my last resort of asking the community. What should I use and how should I access this data from other classes?
    So far I was thinking of HashMaps and ArrayLists but its a pretty tough choice.

    Thanks in advance
     
  2. Offline

    khave

    I usually use my own class with a hashmap storing the key (uuid) and the value (your own class). That way you'll have the useful data in your own class (like kills, wins, deaths etc.)
     
  3. Offline

    CraftCreeper6

  4. Offline

    dontjudgeme1243

    Thanks! I started using HashMaps and it seems to be working really well!
     
  5. Offline

    RoboticPlayer

    You don't really need to use Setters for HashMaps as you can edit them via Getters.
     
  6. Offline

    CraftCreeper6

    @henderry2019
    No, what I meant was setters for specific things to do with the HashMap, e.g: You take two arguments, name, and age. The method will know what to do.
     
Thread Status:
Not open for further replies.

Share This Page