// Path: src/main/java/wdl/range/ProtectionRange.java
// public final class ProtectionRange {
// 	public ProtectionRange(String tag, int x1, int z1, int x2, int z2) {
// 		if (tag == null) {
// 			tag = "";
// 		}
// 		this.tag = tag;
// 		this.x1 = x1;
// 		this.z1 = z1;
// 		this.x2 = x2;
// 		this.z2 = z2;
// 	}
// 	
// 	/**
// 	 * "Tag" for this chunk.  Multiple {@link ProtectionRange}s can share the
// 	 * same tag; this is used to identify sub groups.  May be empty.  If null
// 	 * is passed to the constructor for tag, an empty string is used instead.
// 	 */
// 	public final String tag;
// 	/**
// 	 * Range of coordinates.  If x1 is greater than x2, they will be swapped
// 	 * (and the same for y).  These are chunk coordinates.
// 	 */
// 	public final int x1, z1, x2, z2;
// 	
// 	@Override
// 	public String toString() {
// 		return "Chunks from (" + x1 + ", " + z1 + ") to (" + x2 + ", " + z2
// 				+ ") (tagged " + tag + ")";
// 	}
// }


import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitTask;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import wdl.range.ProtectionRange;

package wdl.request;





/**
 * Represents a single request.
 */
public class PermissionRequest {
	/**
	 * Different states a request can be in.
	 */
	public static enum State {
		/**
		 * The request is waiting on moderator action.
		 */
		WAITING(ChatColor.YELLOW),
		/**
		 * The request has been accepted and the player granted the right permissions.
		 */
		ACCEPTED(ChatColor.GREEN),
		/**
		 * The request has been rejected by a moderator.
		 */
		REJECTED(ChatColor.RED),
		/**
		 * The request has been withdrawn by the submitting player (either
		 * directly or by creating a new request).
		 */
		WITHDRAWN(ChatColor.GRAY, ChatColor.ITALIC, ChatColor.STRIKETHROUGH),
		/**
		 * The request has been revoked by a moderator after previously being
		 * accepted.
		 */
		REVOKED(ChatColor.GRAY, ChatColor.STRIKETHROUGH),
		/**
		 * The request was accepted and has expired after being used.
		 */
		EXPIRED(ChatColor.GRAY, ChatColor.ITALIC);
		
		public final String prefix;
		
		private State(ChatColor... colors) {
			StringBuilder builder = new StringBuilder();
			for (ChatColor color : colors) {
				builder.append(color);
			}
			prefix = builder.toString();
		}
	}
	
	/**
	 * Current state of this permission request.
	 */
	public State state;
	/**
	 * Unique ID of the requesting player.
	 */
	public final UUID playerId;
	/**
	 * Name of the requesting player.
	 */
	public final String playerName;
	/**
	 * The reason for the request from the given player.
	 */
	public final String requestReason;
	/**
	 * The permissions that were requested.
	 */
	public final Map<String, String> requestedPerms;
	/**
	 * The ranges that were requested.
	 */

// Path: src/main/java/wdl/range/ProtectionRange.java
// public final class ProtectionRange {
// 	public ProtectionRange(String tag, int x1, int z1, int x2, int z2) {
// 		if (tag == null) {
// 			tag = "";
// 		}
// 		this.tag = tag;
// 		this.x1 = x1;
// 		this.z1 = z1;
// 		this.x2 = x2;
// 		this.z2 = z2;
// 	}
// 	
// 	/**
// 	 * "Tag" for this chunk.  Multiple {@link ProtectionRange}s can share the
// 	 * same tag; this is used to identify sub groups.  May be empty.  If null
// 	 * is passed to the constructor for tag, an empty string is used instead.
// 	 */
// 	public final String tag;
// 	/**
// 	 * Range of coordinates.  If x1 is greater than x2, they will be swapped
// 	 * (and the same for y).  These are chunk coordinates.
// 	 */
// 	public final int x1, z1, x2, z2;
// 	
// 	@Override
// 	public String toString() {
// 		return "Chunks from (" + x1 + ", " + z1 + ") to (" + x2 + ", " + z2
// 				+ ") (tagged " + tag + ")";
// 	}
// }


// Path: src/main/java/wdl/request/PermissionRequest.java
import java.util.List;
import java.util.Map;
import java.util.UUID;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitTask;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import wdl.range.ProtectionRange;

package wdl.request;





/**
 * Represents a single request.
 */
public class PermissionRequest {
	/**
	 * Different states a request can be in.
	 */
	public static enum State {
		/**
		 * The request is waiting on moderator action.
		 */
		WAITING(ChatColor.YELLOW),
		/**
		 * The request has been accepted and the player granted the right permissions.
		 */
		ACCEPTED(ChatColor.GREEN),
		/**
		 * The request has been rejected by a moderator.
		 */
		REJECTED(ChatColor.RED),
		/**
		 * The request has been withdrawn by the submitting player (either
		 * directly or by creating a new request).
		 */
		WITHDRAWN(ChatColor.GRAY, ChatColor.ITALIC, ChatColor.STRIKETHROUGH),
		/**
		 * The request has been revoked by a moderator after previously being
		 * accepted.
		 */
		REVOKED(ChatColor.GRAY, ChatColor.STRIKETHROUGH),
		/**
		 * The request was accepted and has expired after being used.
		 */
		EXPIRED(ChatColor.GRAY, ChatColor.ITALIC);
		
		public final String prefix;
		
		private State(ChatColor... colors) {
			StringBuilder builder = new StringBuilder();
			for (ChatColor color : colors) {
				builder.append(color);
			}
			prefix = builder.toString();
		}
	}
	
	/**
	 * Current state of this permission request.
	 */
	public State state;
	/**
	 * Unique ID of the requesting player.
	 */
	public final UUID playerId;
	/**
	 * Name of the requesting player.
	 */
	public final String playerName;
	/**
	 * The reason for the request from the given player.
	 */
	public final String requestReason;
	/**
	 * The permissions that were requested.
	 */
	public final Map<String, String> requestedPerms;
	/**
	 * The ranges that were requested.
	 */

	public final List<ProtectionRange> rangeRequests;
