mirror of
https://github.com/bspeice/UNCCGameDay
synced 2024-11-05 15:48:13 -05:00
Move off the HashMap stuff, stick a ParkingCoordinate inside a
ParkingLot
This commit is contained in:
parent
6a37e14a47
commit
5ad1f3b075
@ -44,17 +44,18 @@ public class ParkingClient {
|
|||||||
gds.rateLot(rating, new ParkingLotCallback());
|
gds.rateLot(rating, new ParkingLotCallback());
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<ParkingLot, ParkingLocation> listLotLocation(ParkingLot p){
|
public ParkingLot listLotLocation(ParkingLot p){
|
||||||
HashMap<ParkingLot, ParkingLocation> mMap = new HashMap<ParkingLot, ParkingLocation>();
|
ParkingCoordinate pc = gds.listLotLocation(p.getLocation().getValue());
|
||||||
mMap.put(p, gds.listLotLocation(p.getLocation().getValue()));
|
p.setCoordinate(pc);
|
||||||
return mMap;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<ParkingLot, ParkingLocation> listLotLocation(ParkingChoice c) {
|
public ParkingLot listLotLocation(ParkingChoice c) {
|
||||||
HashMap<ParkingLot, ParkingLocation> mMap = new HashMap<ParkingLot, ParkingLocation>();
|
ParkingCoordinate pc = gds.listLotLocation(c.getValue());
|
||||||
ParkingLot mParkingLot = new ParkingLot();
|
ParkingLot pl = new ParkingLot();
|
||||||
mParkingLot.setLocation(c);
|
pl.setLocation(c);
|
||||||
mMap.put(mParkingLot, gds.listLotLocation(c.getValue()));
|
pl.setCoordinate(pc);
|
||||||
return mMap;
|
return pl;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
33
src/com/uncc/gameday/parking/ParkingCoordinate.java
Normal file
33
src/com/uncc/gameday/parking/ParkingCoordinate.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
package com.uncc.gameday.parking;
|
||||||
|
|
||||||
|
public class ParkingCoordinate {
|
||||||
|
private double latitude;
|
||||||
|
private double longitude;
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
public double getLatitude() {
|
||||||
|
return latitude;
|
||||||
|
}
|
||||||
|
public void setLatitude(double latitude) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
}
|
||||||
|
public double getLongitude() {
|
||||||
|
return longitude;
|
||||||
|
}
|
||||||
|
public void setLongitude(double longitude) {
|
||||||
|
this.longitude = longitude;
|
||||||
|
}
|
||||||
|
public String getLabel() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
public void setLabel(String label) {
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ParkingCoordinate(double latitude, double longitude, String label) {
|
||||||
|
this.latitude = latitude;
|
||||||
|
this.longitude = longitude;
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -1,27 +0,0 @@
|
|||||||
package com.uncc.gameday.parking;
|
|
||||||
|
|
||||||
public class ParkingLocation {
|
|
||||||
|
|
||||||
private int latitude;
|
|
||||||
private int longitude;
|
|
||||||
private String label;
|
|
||||||
|
|
||||||
public int getLatitude() {
|
|
||||||
return latitude;
|
|
||||||
}
|
|
||||||
public void setLatitude(int latitude) {
|
|
||||||
this.latitude = latitude;
|
|
||||||
}
|
|
||||||
public int getLongitude() {
|
|
||||||
return longitude;
|
|
||||||
}
|
|
||||||
public void setLongitude(int longitude) {
|
|
||||||
this.longitude = longitude;
|
|
||||||
}
|
|
||||||
public String getLabel() {
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
public void setLabel(String label) {
|
|
||||||
this.label = label;
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,6 +4,7 @@ public class ParkingLot {
|
|||||||
|
|
||||||
private ParkingChoice location;
|
private ParkingChoice location;
|
||||||
private int filled_pct;
|
private int filled_pct;
|
||||||
|
private ParkingCoordinate coordinate;
|
||||||
|
|
||||||
public int getFilledPct() {
|
public int getFilledPct() {
|
||||||
return filled_pct;
|
return filled_pct;
|
||||||
@ -17,5 +18,11 @@ public class ParkingLot {
|
|||||||
public void setLocation(ParkingChoice location) {
|
public void setLocation(ParkingChoice location) {
|
||||||
this.location = location;
|
this.location = location;
|
||||||
}
|
}
|
||||||
|
public ParkingCoordinate getCoordinate() {
|
||||||
|
return coordinate;
|
||||||
|
}
|
||||||
|
public void setCoordinate(ParkingCoordinate coordinate) {
|
||||||
|
this.coordinate = coordinate;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,14 +2,17 @@ package com.uncc.gameday.rest;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.uncc.gameday.parking.ParkingLocation;
|
import retrofit.Callback;
|
||||||
|
import retrofit.http.Body;
|
||||||
|
import retrofit.http.GET;
|
||||||
|
import retrofit.http.POST;
|
||||||
|
import retrofit.http.Path;
|
||||||
|
|
||||||
|
import com.uncc.gameday.parking.ParkingCoordinate;
|
||||||
import com.uncc.gameday.parking.ParkingLot;
|
import com.uncc.gameday.parking.ParkingLot;
|
||||||
import com.uncc.gameday.parking.ParkingRating;
|
import com.uncc.gameday.parking.ParkingRating;
|
||||||
import com.uncc.gameday.registration.Attendee;
|
import com.uncc.gameday.registration.Attendee;
|
||||||
|
|
||||||
import retrofit.Callback;
|
|
||||||
import retrofit.http.*;
|
|
||||||
|
|
||||||
public interface GamedayService {
|
public interface GamedayService {
|
||||||
|
|
||||||
@GET("/lots/")
|
@GET("/lots/")
|
||||||
@ -22,7 +25,7 @@ public interface GamedayService {
|
|||||||
void rateLot(@Body ParkingRating p, Callback<ParkingLot> lot);
|
void rateLot(@Body ParkingRating p, Callback<ParkingLot> lot);
|
||||||
|
|
||||||
@GET("/lots/{lot}/")
|
@GET("/lots/{lot}/")
|
||||||
ParkingLocation listLotLocation(@Path("lot") String lot);
|
ParkingCoordinate listLotLocation(@Path("lot") String lot);
|
||||||
|
|
||||||
@GET("/register/{id}/")
|
@GET("/register/{id}/")
|
||||||
Attendee getUser(@Path("id") int id);
|
Attendee getUser(@Path("id") int id);
|
||||||
|
Loading…
Reference in New Issue
Block a user