Exemplo n.º 1
0
 public static Site TryMakeSite_SingleSitePart(SiteCoreDef core, string singleSitePartTag, int tile, Faction faction = null, bool disallowNonHostileFactions = true, Predicate <Faction> extraFactionValidator = null, bool ifHostileThenMustRemainHostile = true, float?threatPoints = default(float?))
 {
     if (!SiteMakerHelper.TryFindSiteParams_SingleSitePart(core, singleSitePartTag, out SitePartDef sitePart, out faction, faction, disallowNonHostileFactions, extraFactionValidator))
     {
         return(null);
     }
     return(MakeSite(core, sitePart, tile, faction, ifHostileThenMustRemainHostile, threatPoints));
 }
Exemplo n.º 2
0
        public static bool TryFindSiteParams_SingleSitePart(SiteCoreDef core, string singleSitePartTag, out SitePartDef sitePart, out Faction faction, Faction factionToUse = null, bool disallowAlliedFactions = true, Predicate <Faction> extraFactionValidator = null)
        {
            IEnumerable <SitePartDef> singleSitePartCandidates = (singleSitePartTag == null) ? null : (from x in DefDatabase <SitePartDef> .AllDefsListForReading
                                                                                                       where x.tags.Contains(singleSitePartTag)
                                                                                                       select x);

            return(SiteMakerHelper.TryFindSiteParams_SingleSitePart(core, singleSitePartCandidates, out sitePart, out faction, factionToUse, disallowAlliedFactions, extraFactionValidator));
        }
Exemplo n.º 3
0
 public static Site TryMakeSite_SingleSitePart(IEnumerable <SitePartDef> singleSitePartCandidates, int tile, Faction faction = null, bool disallowNonHostileFactions = true, Predicate <Faction> extraFactionValidator = null, bool ifHostileThenMustRemainHostile = true, float?threatPoints = null)
 {
     if (!SiteMakerHelper.TryFindSiteParams_SingleSitePart(singleSitePartCandidates, out var sitePart, out faction, faction, disallowNonHostileFactions, extraFactionValidator))
     {
         return(null);
     }
     return(MakeSite(sitePart, tile, faction, ifHostileThenMustRemainHostile, threatPoints));
 }
Exemplo n.º 4
0
        public static Site TryMakeSite_SingleSitePart(SiteCoreDef core, string singleSitePartTag, Faction faction = null, bool disallowAlliedFactions = true, Predicate <Faction> extraFactionValidator = null)
        {
            SitePartDef sitePart = default(SitePartDef);

            if (!SiteMakerHelper.TryFindSiteParams_SingleSitePart(core, singleSitePartTag, out sitePart, out faction, faction, disallowAlliedFactions, extraFactionValidator))
            {
                return(null);
            }
            return(SiteMaker.MakeSite(core, sitePart, faction));
        }
Exemplo n.º 5
0
        public static Site TryMakeSite_SingleSitePart(SiteCoreDef core, IEnumerable <SitePartDef> singleSitePartCandidates, Faction faction = null, bool disallowAlliedFactions = true, Predicate <Faction> extraFactionValidator = null)
        {
            SitePartDef sitePart;

            if (!SiteMakerHelper.TryFindSiteParams_SingleSitePart(core, singleSitePartCandidates, out sitePart, out faction, faction, disallowAlliedFactions, extraFactionValidator))
            {
                return(null);
            }
            return(SiteMaker.MakeSite(core, sitePart, faction));
        }
Exemplo n.º 6
0
        public static Site TryMakeSite_SingleSitePart(SiteCoreDef core, string singleSitePartTag, Faction faction = null, bool disallowNonHostileFactions = true, Predicate <Faction> extraFactionValidator = null, bool ifHostileThenMustRemainHostile = true)
        {
            SitePartDef sitePart;
            Site        result;

            if (!SiteMakerHelper.TryFindSiteParams_SingleSitePart(core, singleSitePartTag, out sitePart, out faction, faction, disallowNonHostileFactions, extraFactionValidator))
            {
                result = null;
            }
            else
            {
                result = SiteMaker.MakeSite(core, sitePart, faction, ifHostileThenMustRemainHostile);
            }
            return(result);
        }