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); }
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); }