public static bool CanLandInSpecificCell(IEnumerable <IThingHolder> pods, MapParent mapParent)
 {
     return(mapParent != null && mapParent.Spawned && mapParent.HasMap && (!mapParent.EnterCooldownBlocksEntering() || FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(new object[]
     {
         mapParent.EnterCooldownDaysLeft().ToString("0.#")
     }))));
 }
コード例 #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.EnterCooldownDaysLeft().ToString("0.#"))));
     }
     return(true);
 }
コード例 #3
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.EnterCooldownDaysLeft().ToString("0.#"))));
     }
     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);
 }
コード例 #5
0
        public static FloatMenuAcceptanceReport CanEnter(Caravan caravan, MapParent mapParent)
        {
            FloatMenuAcceptanceReport result;

            if (mapParent == null || !mapParent.Spawned || !mapParent.HasMap)
            {
                result = false;
            }
            else if (mapParent.EnterCooldownBlocksEntering())
            {
                result = FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(new object[]
                {
                    mapParent.EnterCooldownDaysLeft().ToString("0.#")
                }));
            }
            else
            {
                result = true;
            }
            return(result);
        }
        public static FloatMenuAcceptanceReport CanVisit(Caravan caravan, MapParent escapeShip)
        {
            FloatMenuAcceptanceReport result;

            if (escapeShip == null || !escapeShip.Spawned || escapeShip.GetComponent <EscapeShipComp>() == null)
            {
                result = false;
            }
            else if (escapeShip.EnterCooldownBlocksEntering())
            {
                result = FloatMenuAcceptanceReport.WithFailMessage("MessageEnterCooldownBlocksEntering".Translate(new object[]
                {
                    escapeShip.EnterCooldownDaysLeft().ToString("0.#")
                }));
            }
            else
            {
                result = true;
            }
            return(result);
        }