示例#1
0
 public override TransportState Process(Transport transport)
 {
     if (transport.CanFinishUnloading())
     {
         transport.FinishUnloading();
         transport.ReturnToOrigin();
         return(Returning);
     }
     return(this);
 }
示例#2
0
 public override TransportState Process(Transport transport)
 {
     if (transport.IsAtDestination())
     {
         transport.ArriveAtRouteDestination();
         transport.StartUnloading();
         if (transport.CanFinishUnloading())
         {
             transport.FinishUnloading();
             transport.ReturnToOrigin();
             return(Returning);
         }
         else
         {
             return(Unloading);
         }
     }
     return(this);
 }