Advertisement
ExpDev

MemoryPoints

May 7th, 2017
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. package me.expdev.gkitpvp.persist;
  2.  
  3. import me.expdev.gkitpvp.GLocation;
  4. import me.expdev.gkitpvp.Points;
  5.  
  6. import java.util.Map;
  7. import java.util.concurrent.ConcurrentSkipListMap;
  8.  
  9. /**
  10.  * Project created by ExpDev
  11.  */
  12.  
  13.  
  14. public abstract class MemoryPoints extends Points {
  15.  
  16.     public GLocation spawn = null;
  17.     public Map<String, GLocation> points = new ConcurrentSkipListMap<String, GLocation>(String.CASE_INSENSITIVE_ORDER);
  18.  
  19.     public GLocation getSpawn() {
  20.         return spawn;
  21.     }
  22.  
  23.     public void setSpawn(GLocation spawn) {
  24.         this.spawn = spawn;
  25.     }
  26.  
  27.     public GLocation getPoint(String id) {
  28.         return points.get(id);
  29.     }
  30.  
  31.     public void addPoint(String id, GLocation where) {
  32.         points.put(id, where);
  33.     }
  34.  
  35.     public void removePoint(String id) {
  36.         points.remove(id);
  37.     }
  38.  
  39.     // LOAD
  40.     @Override
  41.     public abstract void loadAll();
  42.  
  43.     // SAVE
  44.     @Override
  45.     public abstract void forceSaveAll();
  46.  
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement