예제 #1
0
 public IdleDestinationStorage(Type locationType, ResumeTimeCallback onInterruptCallback, SimpleDescriptor locationCallback, GameDateTime timeToBoogie)
 {
     this.locationType        = locationType ?? throw new ArgumentNullException(nameof(locationType));
     this.locationCallback    = locationCallback;
     this.onInterruptCallback = onInterruptCallback ?? throw new ArgumentNullException(nameof(onInterruptCallback));
     travelTime = timeToBoogie ?? throw new ArgumentNullException(nameof(timeToBoogie));
 }
예제 #2
0
 /// <summary>
 /// Reserve a certain number of hours to be consumed, but allow any interrupts or special events to use these hours as they see fit. If any hour is interrupted, the resumeCallback
 /// will be called after all interrupts for that hour are handled. If no hours are interrupted, the default text will be called and displayed, if possible. during the final hour,
 /// the location will be changed to the given value. Note that it's possible for an idle to be cancelled, and if this happens the player will not reach the given destination.
 /// </summary>
 /// <typeparam name="T">the area to travel to after idleing</typeparam>
 /// <param name="hours">the number of hours to idle away</param>
 /// <param name="onInterruptCallback">the function called after all interrupts for a given hour have been processed.</param>
 /// <param name="defaultText">Any text to display if no interrupts are processed (optional)</param>
 internal void IdleHoursChangeLocation <T>(byte hours, ResumeTimeCallback onInterruptCallback, SimpleDescriptor defaultText = null) where T : AreaBase
 {
     IdleHoursPrivate(hours);
     DoIdleChange(new IdleDestinationStorage(typeof(T), onInterruptCallback, defaultText, currentTime.Delta(idleHours)));
     RunEngine();
 }
예제 #3
0
 internal void IdleHoursChangeLocationToBase(byte hours, ResumeTimeCallback onInterruptCallback, SimpleDescriptor defaultText = null)
 {
     IdleHoursPrivate(hours);
     DoIdleChange(new IdleDestinationStorage(areaEngine.currentHomeBase.GetType(), onInterruptCallback, defaultText, currentTime.Delta(idleHours)));
     RunEngine();
 }
예제 #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="hours"></param>
 /// <param name="resumeCallback"></param>
 /// <param name="mustEndUpHere"></param>
 internal void IdleHours(byte hours, ResumeTimeCallback resumeCallback)
 {
     IdleHoursPrivate(hours);
     RunEngine();
 }