mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Refactor mark related classes.
- Mark is an abstract class which containing its name and type - Single Mark is a sub class of Mark which containing only one GPS location - Gate Mark is a sub class of Mark which containing two Single Marks #refactor #fix #story[10] #story[11] #story[12]
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
package seng302.models.mark;
|
||||
|
||||
/**
|
||||
* Represents the marker as a single mark
|
||||
*
|
||||
* Created by Haoming Yin (hyi25) on 17/3/2017
|
||||
*/
|
||||
public class SingleMark extends Mark {
|
||||
private double lat;
|
||||
private double lon;
|
||||
private String name;
|
||||
|
||||
|
||||
/**
|
||||
* Represents a marker
|
||||
*
|
||||
* @param name, the name of the marker*
|
||||
* @param lat, the latitude of the marker
|
||||
* @param lon, the longitude of the marker
|
||||
*/
|
||||
public SingleMark(String name, double lat, double lon) {
|
||||
super(name, MarkType.SINGLE_MARK);
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the marker at the beginning of a leg
|
||||
*
|
||||
* @param name, the name of the marker
|
||||
*/
|
||||
public SingleMark(String name) {
|
||||
super(name, MarkType.SINGLE_MARK);
|
||||
this.lat = 0;
|
||||
this.lon = 0;
|
||||
}
|
||||
|
||||
public double getLatitude() {
|
||||
return this.lat;
|
||||
}
|
||||
|
||||
public double getLongitude() {
|
||||
return this.lon;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user