package story.scheherazade.misc;

import story.dbcore.exceptions.*;
import story.dbcore.nodes.*;
import story.scheherazade.elements.*;
import story.scheherazade.parameters.*;
import story.dbcore.misc.*;

/**
 * Like a NamedLocation, but for Locations not yet validated (i.e., loading from file).
 */

public class LocationWithName implements RenderableObject {

    private Location location;
    private LocationName name;

    public LocationWithName (Location location, LocationName name) throws Scheherexception {

	if (location == null) {
	    throw new Scheherexception("Can't work with null location.");
	}

	this.location = location;
	this.name = name;
    }

    /**
     * Get the location.
     */
    public Location getLocation () {
	return location;
    }

    /**
     * Get the name, potentially null.
     */
    public NounName getName () {
	return name;
    }


    public StringBuffer render () throws Scheherexception {
	return new StringBuffer(location.render()+"->\""+name+"\"");
    }

}
