package org.tournier.minecraftregionmanager;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.UUID;

public class ReportedSpot {
	// A reported spot is defined by 4 items:
	private String worldName;
	private int x, z;
	private String reportReason;
	
	// And associated to a list of player's UUID
	private LinkedList<UUID> reportingPlayers;
	
	// Constructor
    public ReportedSpot(String world, int sx, int sz, String reason, UUID id) {
        worldName = world;
        x = sx;
        z = sz;
        reportReason = reason.toLowerCase();
        reportingPlayers = new LinkedList<UUID>();
        reportingPlayers.addLast(id);
    }
    
    public String getWorldName() {
    	return worldName;
    }
    
    public int getX() {
    	return x;
    }
    
    public int getZ() {
    	return z;
    }
    
    public String getReportReason() {
    	return reportReason;
    }
    
    public LinkedList<UUID> getReportingPlayers() {
    	return reportingPlayers;
    }
    
    public boolean IsPlayerAmongReporters(UUID id) {
        Iterator<UUID> i = reportingPlayers.iterator();
        while(i.hasNext()){
        	UUID u = i.next();
        	if (u.equals(id)) {
        		return true;
        	}
        }
    	return false;
    }

    public void AddReporter(UUID id) {
    	reportingPlayers.addLast(id);
    }
    
    public String printMark() {
    	String s = worldName + ":" + x + "," + z + ":" + reportReason + " (reported by " + reportingPlayers.size() + " player";
    	if (reportingPlayers.size() > 1) {
    		s += "s";
    	}
    	s += ")";
    	return s;
    }
}

@@ -150,17 +150,18 @@
 rtedSpot
- 
+%0D%0A
 %7B%0D%0A%09// A
@@ -462,32 +462,37 @@
 reason, UUID id)
+%0D%0A   
  %7B%0D%0A        worl
@@ -723,16 +723,21 @@
 ldName()
+%0D%0A   
  %7B%0D%0A    
@@ -790,16 +790,21 @@
 t getX()
+%0D%0A   
  %7B%0D%0A    
@@ -849,16 +849,21 @@
 t getZ()
+%0D%0A   
  %7B%0D%0A    
@@ -922,16 +922,21 @@
 Reason()
+%0D%0A   
  %7B%0D%0A    
@@ -1020,16 +1020,21 @@
 layers()
+%0D%0A   
  %7B%0D%0A    
@@ -1115,32 +1115,37 @@
 porters(UUID id)
+%0D%0A   
  %7B%0D%0A        Iter
@@ -1215,16 +1215,26 @@
 sNext())
+%0D%0A        
 %7B%0D%0A     
@@ -1283,18 +1283,16 @@
 als(id))
- %7B
 %0D%0A      
@@ -1313,20 +1313,8 @@
 e;%0D%0A
-        %09%7D%0D%0A
     
@@ -1385,16 +1385,21 @@
 UUID id)
+%0D%0A   
  %7B%0D%0A    
@@ -1472,16 +1472,21 @@
 ntMark()
+%0D%0A   
  %7B%0D%0A    
@@ -1644,18 +1644,16 @@
 e() %3E 1)
- %7B
 %0D%0A    %09%09
@@ -1667,16 +1667,8 @@
 %22;%0D%0A
-    %09%7D%0D%0A
     

Update to v1.00