private void CheckZoneUsage(Journey journey) { if (_zoneUsed < journey.Zone) { DailyCostCap = Prices.DailyCapZoneB; _zoneUsed = Zone.B; } }
public void AddJourney(Journey journey) { if (JourneyList.Count >= 1) journey.CheckIsReturnJourney(JourneyList.Last()); JourneyList.Add(journey); CheckZoneUsage(journey); CalculateDiscount(); }
public void CheckIsReturnJourney(Journey previousJourney) { this.IsReturnJourney = (previousJourney.Destination == this.Origin && previousJourney.Origin == this.Destination); if (this.IsReturnJourney && !previousJourney.IsReturnJourney) { if (this.Zone == Zone.A) this.Cost = Prices.ReturnZoneA; else this.Cost = Prices.ReturnZoneB; } }
public void PerformJourney(Journey journey) { OysterCard.AddJourney(journey); }