Exemplo n.º 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));
 }
Exemplo n.º 2
0
 private void RunEngine()
 {
     if (!running && totalHours > 0)
     {
         startTime          = engineTime;
         hitLazies          = false;
         currentContentPage = pageMaker();
         InitializeNewHour();
     }
     else if (running)
     {
         QueryPageStatus();
     }
     else
     {
         areaEngine.RunArea();
     }
 }
Exemplo n.º 3
0
        private void ReturnExectution()
        {
            bool newPage = !currentContentPage.hasNoText;

            //i'm placing the final destination text on the current content page. However, if the only thing on the current context page is just this text,
            //it shouldn't get its own page, so that will appear on the same page as the destination context.

            string text;

            if (!string.IsNullOrEmpty(newHourHeader))
            {
                text = newHourHeader;
            }
            else
            {
                text = finalDestination?.GetFinalText();                 //trudge toward your final destination.
            }
            if (!string.IsNullOrWhiteSpace(text))
            {
                currentContentPage.OutputText(text);
                //hasAnyOutput = true; imo this would be annoying if this was the only thing that forced it to a new page.
            }

            startTime     = null;
            newHourHeader = null;
            hitLazies     = false;

            if (!newPage)
            {
                areaEngine.RunArea();
            }
            else
            {
                currentContentPage.DoNext(areaEngine.RunArea);
                SetCurrentPage(currentContentPage);
            }

            currentContentPage = null;
        }