package net.amigocraft.pore.impl;

import org.apache.commons.lang.NotImplementedException;
import org.bukkit.Location;
import org.bukkit.entity.Player;

import java.util.Map;
import java.util.UUID;

//TODO: skeleton implementation

//TODO: skeleton implementation

public class PoreOfflinePlayer implements org.bukkit.OfflinePlayer {

	@Override
	public boolean isOnline() {
		throw new NotImplementedException();
	}

	@Override
	public String getName() {
		throw new NotImplementedException();
	}

	@Override
	public UUID getUniqueId() {
		throw new NotImplementedException();
	}

	@Override
	public boolean isBanned() {
		throw new NotImplementedException();
	}

	@Override
	public void setBanned(boolean banned) {
		throw new NotImplementedException();
	}

	@Override
	public boolean isWhitelisted() {
		throw new NotImplementedException();
	}

	@Override
	public void setWhitelisted(boolean value) {
		throw new NotImplementedException();
	}

	@Override
	public Player getPlayer() {
		throw new NotImplementedException();
	}

	@Override
	public long getFirstPlayed() {
		throw new NotImplementedException();
	}

	@Override
	public long getLastPlayed() {
		throw new NotImplementedException();
	}

	@Override
	public boolean hasPlayedBefore() {
		throw new NotImplementedException();
	}

	@Override
	public Location getBedSpawnLocation() {
		throw new NotImplementedException();
	}

	@Override
	public Map<String, Object> serialize() {
		throw new NotImplementedException();
	}

	@Override
	public boolean isOp() {
		throw new NotImplementedException();
	}

	@Override
	public void setOp(boolean value) {
		throw new NotImplementedException();
	}
}

@@ -39,299 +39,1023 @@
 ort 
-org.apache.commons.lang.NotImplementedException;%0Aimport org.bukkit.Location;%0Aimport org.bukkit.entity.Player;%0A%0Aimport java.util.Map;%0Aimport java.util.UUID;%0A%0A//TODO: skeleton implementation%0A%0A//TODO: skel
+com.google.common.base.Optional;%0Aimport net.amigocraft.pore.impl.entity.PorePlayer;%0Aimport net.amigocraft.pore.util.PoreWrapper;%0Aimport net.amigocraft.pore.util.converter.TypeConverter;%0Aimport org.apache.commons.lang.NotImplementedException;%0Aimport org.bukkit.Location;%0Aimport org.bukkit.entity.Player;%0Aimport org.spongepowered.api.entity.player.User;%0A%0Aimport java.util.Map;%0Aimport java.util.UUID;%0A%0Apublic class PoreOfflinePlayer extends PoreWrapper%3CUser%3E implements org.bukkit.OfflinePlayer %7B%0A%09private static TypeConverter%3CUser, PoreOfflinePlayer%3E converter;%0A%0A%09static TypeConverter%3CUser, PoreOfflinePlayer%3E g
 et
+C
 on
- implementation%0A%0Apublic class PoreOfflinePlayer implements org.bukkit.OfflinePlayer %7B
+verter() %7B%0A%09%09if (converter == null) %7B%0A%09%09%09converter = new TypeConverter%3CUser, PoreOfflinePlayer%3E() %7B%0A%09%09%09%09@Override%0A%09%09%09%09protected PoreOfflinePlayer convert(User handle) %7B%0A%09%09%09%09%09return new PoreOfflinePlayer(handle);%0A%09%09%09%09%7D%0A%09%09%09%7D;%0A%09%09%7D%0A%0A%09%09return converter;%0A%09%7D%0A%0A%09protected PoreOfflinePlayer(User handle) %7B%0A%09%09super(handle);%0A%09%7D%0A%0A%09public static PoreOfflinePlayer of(User user) %7B%0A%09%09return converter.apply(user);%0A%09%7D
 %0A%0A%09@
@@ -1098,41 +1098,35 @@
 %7B%0A%09%09
-throw new NotImplementedException
+return getHandle().isOnline
 ();%0A
@@ -1173,41 +1173,34 @@
 %7B%0A%09%09
-throw new NotImplementedException
+return getHandle().getName
 ();%0A
@@ -1249,41 +1249,38 @@
 %7B%0A%09%09
-throw new NotImplementedException
+return getHandle().getUniqueId
 ();%0A
@@ -1329,41 +1329,35 @@
 %7B%0A%09%09
-throw new NotImplementedException
+return getHandle().isBanned
 ();%0A
@@ -1506,41 +1506,40 @@
 %7B%0A%09%09
-throw new NotImplementedException
+return getHandle().isWhitelisted
 ();%0A
@@ -1687,44 +1687,192 @@
 %7B%0A%09%09
-throw new NotImplementedException();
+Optional%3Corg.spongepowered.api.entity.player.Player%3E player = getHandle().getPlayer();%0A%09%09if (player.isPresent()) %7B%0A%09%09%09return PorePlayer.of(player.get());%0A%09%09%7D else %7B%0A%09%09%09return null;%0A%09%09%7D
 %0A%09%7D%0A

Implement OfflinePlayer