示例#1
0
 public void RunProgram()
 {
     while (true)
     {
         if (RandomMethods.RandomWaitIsDone())
         {
             if (RandomSeed.Next(1, 3) == 1)
             {
                 RandomMethods.GenerateRandomVisit();
             }
             else
             {
                 RandomMethods.RandomVisitorLeaves();
             }
         }
         Thread.Sleep(25);
     }
 }
示例#2
0
 public static void GenerateRandomVisit()
 {
     if (RandomMethods.NewRandomVisit())
     {
         PersonResult visitor = RandomMethods.AddRandomGeneratedVisitor();
         if (visitor != null)
         {
             var starship = GetRandomVehicleOrStarship(visitor);
             if (SpacePark.IsCorrectLength(starship.doubleLength))
             {
                 SpacePark.ParkSpaceship(visitor.Name, starship.Name);
                 SpacePark.Print("Guard", "Your ship is parked.", true);
             }
             else
             {
                 SpacePark.Print("Guard", $"I'm sorry but your spaceship is too big!", true);
             }
         }
         else
         {
             SpacePark.Print("World", "The visitor left.", true);
         }
     }
 }