Created BoatsParser.java to parse boats from server boat.xml and created a table on the start screen to display all the teams from server

#story[572]
This commit is contained in:
Zhi You Tan
2017-04-30 17:17:47 +12:00
parent f3ee618900
commit 25038da2a1
6 changed files with 203 additions and 15 deletions
+30
View File
@@ -21,6 +21,10 @@ public class Boat {
private int markLastPast;
private String shortName;
private int id;
// new attributes to boat
private int sourceID;
private String boatName;
private String country;
public Boat(String teamName) {
this.teamName = teamName;
@@ -45,6 +49,21 @@ public class Boat {
this.id = id;
}
/**
* New instance created by BoatsParser.
*
* @param sourceID source ID of the boat
* @param boatName full name of the boat
* @param shortName short name of the boat
* @param country country of the boat
*/
public Boat(int sourceID, String boatName, String shortName, String country) {
this.sourceID = sourceID;
this.boatName = boatName;
this.shortName = shortName;
this.country = country;
}
/**
* Returns the name of the team sailing the boat
*
@@ -141,4 +160,15 @@ public class Boat {
return id;
}
public int getSourceID() {
return sourceID;
}
public String getBoatName() {
return boatName;
}
public String getCountry() {
return country;
}
}