/// <summary> /// Posts the request. /// </summary> /// <returns>True if posting succeeded, false otherwise.</returns> /// <param name="request">Request to post.</param> public async Task <bool> PostRequest(RideRequest request) { if (IsStale) { return(false); } IPendingRideRelatedRequest response = await RideRequester.SubmitRideRequest(request); if (response != null) { TransitionTo(new RequestPendingState(this, response, request)); return(true); } return(false); }
/// <summary> /// Posts the offer. /// </summary> /// <returns>True if posting succeeded, false otherwise.</returns> /// <param name="offer">Offer to post.</param> public async Task <bool> PostOffer(RideOffer offer) { if (IsStale) { return(false); } IPendingRideRelatedRequest response = await RideOfferer.SubmitRideOffer(offer); if (response != null) { TransitionTo(new OfferPendingState(this, response, offer)); return(true); } return(false); }
public OfferPendingState(Ridesharing.StateBase previous, IPendingRideRelatedRequest response, RideOffer offer) : base(previous, response) { Offer = offer; }
protected AbstractPendingState(Ridesharing.StateBase previous, IPendingRideRelatedRequest response) : base(previous) { this.response = response; }
public RequestPendingState(Ridesharing.StateBase previous, IPendingRideRelatedRequest response, RideRequest request) : base(previous, response) { Request = request; }