Good way of doing Duels

Discussion in 'Plugin Development' started by Irantwomiles, May 23, 2016.

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

    Irantwomiles

    I've been using just a regular Hashmap to do this but as I progressed into the plug-in I realized that something's we're just wrong. I'm asking for guidance.
     
  2. Offline

    teej107

    What is wrong? We can't help you without knowing what's wrong.
     
  3. Offline

    Lordloss

  4. I suggest that you use a separate class for duels, and store those classes in a HashMap for players (I.e., you can retrieve someone's Duel through their player UUID, if they're currently in a duel).

    If you need pointers on how to make and use separate classes for storing data, feel free to ask and I can give you the answer or some headers.

    Example:

    HashMap<UUID, Duel> duels = new HashMap<UUID, Duel);

    Duel methods:

    UUID getP1()
    UUID getP2()
    void start()
    void finish(UUID winner)
     
  5. Offline

    MadMaxCookie

    additional :

    set the UUID player1 and player 2's location to their own spawn.

    the one who is dead lost then get the killer for winner :D
     
Thread Status:
Not open for further replies.

Share This Page