mirror of
				https://github.com/bspeice/UNCCGameDay
				synced 2025-11-04 02:10:35 -05:00 
			
		
		
		
	Split the RegistrationClient into registration and parking
This commit is contained in:
		
							
								
								
									
										44
									
								
								src/com/uncc/gameday/parking/ParkingClient.java
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								src/com/uncc/gameday/parking/ParkingClient.java
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,44 @@
 | 
			
		||||
package com.uncc.gameday.parking;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import retrofit.RestAdapter;
 | 
			
		||||
import android.content.Context;
 | 
			
		||||
 | 
			
		||||
import com.uncc.gameday.R;
 | 
			
		||||
import com.uncc.gameday.rest.GamedayService;
 | 
			
		||||
 | 
			
		||||
public class ParkingClient {
 | 
			
		||||
 | 
			
		||||
	private GamedayService gds;
 | 
			
		||||
	
 | 
			
		||||
	public ParkingClient(Context c) {
 | 
			
		||||
		RestAdapter ra = new RestAdapter.Builder()
 | 
			
		||||
			.setServer("http://" + c.getString(R.string.server_hostname))
 | 
			
		||||
			.build();
 | 
			
		||||
		gds = ra.create(GamedayService.class);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public List<ParkingLot> listLots() {
 | 
			
		||||
		return gds.listLots();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public ParkingLot listLot(ParkingChoices choice) {
 | 
			
		||||
		return gds.listLot(choice.getValue());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public ParkingLot listLot(ParkingLot lot) {
 | 
			
		||||
		return gds.listLot(lot.getLocation().getValue());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public void rateLot(RatingChoices rating, ParkingChoices parkingLot) {
 | 
			
		||||
		ParkingRating pRating = new ParkingRating();
 | 
			
		||||
		pRating.setParkingLot(parkingLot);
 | 
			
		||||
		pRating.setRating(rating);
 | 
			
		||||
		gds.rateLot(pRating, new ParkingLotCallback());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public void rateLot(ParkingRating rating) {
 | 
			
		||||
		gds.rateLot(rating, new ParkingLotCallback());
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -24,29 +24,6 @@ public class RegistrationClient {
 | 
			
		||||
		gds = ra.create(GamedayService.class);
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public List<ParkingLot> listLots() {
 | 
			
		||||
		return gds.listLots();
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public ParkingLot listLot(ParkingChoices choice) {
 | 
			
		||||
		return gds.listLot(choice.getValue());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public ParkingLot listLot(ParkingLot lot) {
 | 
			
		||||
		return gds.listLot(lot.getLocation().getValue());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public void rateLot(RatingChoices rating, ParkingChoices parkingLot) {
 | 
			
		||||
		ParkingRating pRating = new ParkingRating();
 | 
			
		||||
		pRating.setParkingLot(parkingLot);
 | 
			
		||||
		pRating.setRating(rating);
 | 
			
		||||
		gds.rateLot(pRating, new ParkingLotCallback());
 | 
			
		||||
	}
 | 
			
		||||
	
 | 
			
		||||
	public void rateLot(ParkingRating rating) {
 | 
			
		||||
		gds.rateLot(rating, new ParkingLotCallback());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	public void registerAttendee(Attendee a) {
 | 
			
		||||
		gds.registerUser(a, new AttendeeCallback());
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user