package org.studiorailgun.sim.space.util;

import org.studiorailgun.sim.space.Location;
import org.studiorailgun.sim.space.Region;
import org.studiorailgun.sim.space.World;

/**
 * Utilities for resolving locations
 */
public class LocationResolver {
    
    /**
     * Gets the first location available
     * @return The location
     */
    public static Location first(World world){
        Region root = world.getRegion();
        while(root.getLocations().size() < 1){
            root = root.getChildren().get(0);
        }
        return root.getLocations().get(0);
    }

}
