コード例 #1
0
 public static FloatMenuAcceptanceReport CanEnter(Caravan caravan, MapParent mapParent)
 {
     if (mapParent == null || !mapParent.Spawned || !mapParent.HasMap)
     {
         return(false);
     }
     if (mapParent.EnterCooldownBlocksEntering())
     {
         return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(mapParent.EnterCooldownTicksLeft().ToStringTicksToPeriod())));
     }
     return(true);
 }
コード例 #2
0
 public static bool CanLandInSpecificCell(IEnumerable <IThingHolder> pods, MapParent mapParent)
 {
     if (mapParent == null || !mapParent.Spawned || !mapParent.HasMap)
     {
         return(false);
     }
     if (mapParent.EnterCooldownBlocksEntering())
     {
         return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(mapParent.EnterCooldownTicksLeft().ToStringTicksToPeriod())));
     }
     return(true);
 }
 public static FloatMenuAcceptanceReport CanVisit(Caravan caravan, MapParent escapeShip)
 {
     if (escapeShip == null || !escapeShip.Spawned || escapeShip.GetComponent <EscapeShipComp>() == null)
     {
         return(false);
     }
     if (escapeShip.EnterCooldownBlocksEntering())
     {
         return(FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(escapeShip.EnterCooldownTicksLeft().ToStringTicksToPeriod())));
     }
     return(true);
 }