package de.tud.kom.p2psim.impl.topology.movement.modularosm.attraction;

import de.tud.kom.p2psim.impl.topology.util.PositionVector;
import de.tudarmstadt.maki.simonstrator.api.component.sensor.location.IAttractionPoint;
import de.tudarmstadt.maki.simonstrator.api.util.XMLConfigurableConstructor;

/**
 * A basic attraction point, as simple as it can get. Really just a named location
 * without any checks performed.
 */
public class BasicAttractionPoint extends PositionVector implements IAttractionPoint
{
    protected String name;
       
    public BasicAttractionPoint(String name, PositionVector pos) {
        super(pos);
        this.name = name;
    } 

    @XMLConfigurableConstructor({ "name", "x", "y" })
    public BasicAttractionPoint(String name, double x, double y) {
    	this(name, new PositionVector(x, y));
    }
    
    @Override
    public String getName() {
        return name;
    }
   
    @Override
    public IAttractionPoint clone(String newName) {
        return new BasicAttractionPoint(newName, this);
    } 
    
}
