You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

70 lines
1.6 KiB

package shared.model;
import shared.xml.Race.XMLMark;
import java.math.BigDecimal;
import java.math.BigInteger;
/**
* Represents an individual mark.
* Has a source ID, name, and position.
*/
public class Mark extends XMLMark{
/**
* The position of the mark.
*/
private GPSCoordinate position;
/**
* Constructs a mark with a given source ID, name, and position.
* @param sourceID The source ID of the mark.
* @param name The name of the mark.
* @param position The position of the mark.
*/
public Mark(int sourceID, String name, GPSCoordinate position) {
super();
targetLat = position.getLatitude();
targetLng = position.getLongitude();
setSourceID(sourceID);
setName(name);
this.position = position;
}
/**
* Used to create marks that are not visible in the race
* @param position position of the mark
* @return the new mark
*/
public static Mark tempMark(GPSCoordinate position){
return new Mark(-1, "Hidden Mark", position);
}
/**
* Returns the name of the mark.
* @return The name of the mark.
*/
public String getName() {
return name;
}
/**
* Returns the position of the mark.
* @return The position of the mark.
*/
public GPSCoordinate getPosition() {
return position;
}
/**
* Sets the position of the mark to a specified GPSCoordinate.
* @param position The new GPSCoordinate to use.
*/
public void setPosition(GPSCoordinate position) {
this.position = position;
}
}