package com.publicuhc.scatter.example;

import com.publicuhc.scatter.LocationMapping;
import com.publicuhc.scatter.PlayerScatterer;
import com.publicuhc.scatter.exceptions.ScatterLocationException;
import com.publicuhc.scatter.logic.RandomCircleScatterLogic;
import com.publicuhc.scatter.logic.ScatterLogic;
import com.publicuhc.scatter.zones.CircularDeadZoneBuilder;
import com.publicuhc.scatter.zones.DeadZone;
import com.publicuhc.scatter.zones.SquareDeadZoneBuilder;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.Player;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;

public class ExampleFetch {

    public void exampleFetch() {

        ScatterLogic logic = new RandomCircleScatterLogic(
                new Random(),
                new Location(Bukkit.getWorld("world"), 0, 0, 0),
                100,
                800,
                Material.GRASS, Material.ACACIA_STAIRS, Material.SAND
        );

        List<Player> players = Arrays.asList(Bukkit.getOnlinePlayers());

        List<DeadZone> deadZones = new ArrayList<DeadZone>();

        SquareDeadZoneBuilder builder = new SquareDeadZoneBuilder(100);

        DeadZone spawnZone = builder.buildForLocation(Bukkit.getWorld("world").getSpawnLocation());
        deadZones.add(spawnZone);

        CircularDeadZoneBuilder deadZoneForTeleports = new CircularDeadZoneBuilder(30);

        PlayerScatterer scatterer = new PlayerScatterer(logic, players, deadZones, deadZoneForTeleports);

        try {
            List<LocationMapping> mappings = scatterer.getScatterLocations();

            //mappings is UUID=>Location for all the provided players, just need to teleport them as needed
        } catch (ScatterLocationException e) {
            //couldn't fetch all locations
        }
    }
}

@@ -62,31 +62,32 @@
 scatter.
-LocationMapping
+DefaultScatterer
 ;%0Aimport
@@ -109,22 +109,16 @@
 scatter.
-Player
 Scattere
@@ -1460,22 +1460,16 @@
         
-Player
 Scattere
@@ -1486,22 +1486,23 @@
 r = new 
-Player
+Default
 Scattere
@@ -1509,25 +1509,16 @@
 r(logic,
- players,
  deadZon
@@ -1588,24 +1588,18 @@
 tion
-Mapping%3E mapping
+%3E location
 s = 
@@ -1628,16 +1628,30 @@
 cations(
+players.size()
 );%0A%0A    
@@ -1664,101 +1664,45 @@
   //
-mappings is UUID=%3ELocation for all the provided players, just need to teleport them as needed
+shuffle locations + teleport players%0A
 %0A   

update to compile