mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Added docstrings for Marker class
Tags: #docs
This commit is contained in:
@@ -6,23 +6,48 @@ class Marker{
|
|||||||
private String name;
|
private String name;
|
||||||
private ArrayList<Boat> boatOrder;
|
private ArrayList<Boat> boatOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents the marker at the beginning of a leg
|
||||||
|
*
|
||||||
|
* @param name, the name of the marker
|
||||||
|
*/
|
||||||
public Marker(String name){
|
public Marker(String name){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.boatOrder = new ArrayList<Boat>();
|
this.boatOrder = new ArrayList<Boat>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the name of the marker
|
||||||
|
*
|
||||||
|
* @param name, the name of the marker
|
||||||
|
*/
|
||||||
public void setName(String name){
|
public void setName(String name){
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the name of the marker
|
||||||
|
*
|
||||||
|
* @return the name of the marker
|
||||||
|
*/
|
||||||
public String getName(){
|
public String getName(){
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a boat as they pass the marker
|
||||||
|
*
|
||||||
|
* @param boat, the boat that passed the marker
|
||||||
|
*/
|
||||||
public void addBoat(Boat boat){
|
public void addBoat(Boat boat){
|
||||||
this.boatOrder.add(boat);
|
this.boatOrder.add(boat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of boats in the order they passed the marker
|
||||||
|
*
|
||||||
|
* @return An array of boats in the order they passed the marker
|
||||||
|
*/
|
||||||
public Boat[] getBoats(){
|
public Boat[] getBoats(){
|
||||||
return this.boatOrder.toArray(new Boat[this.boatOrder.size()]);
|
return this.boatOrder.toArray(new Boat[this.boatOrder.size()]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user