예제 #1
0
 private static bool FactionCanOwn(SiteCoreOrPartDefBase siteDefBase, Faction faction, bool disallowNonHostileFactions, Predicate <Faction> extraFactionValidator)
 {
     if (siteDefBase == null)
     {
         Log.Error("Called FactionCanOwn() with null SiteDefBase.", false);
         return(false);
     }
     return(siteDefBase.FactionCanOwn(faction) && (!disallowNonHostileFactions || faction == null || faction.HostileTo(Faction.OfPlayer)) && (extraFactionValidator == null || extraFactionValidator(faction)));
 }
예제 #2
0
 private static bool FactionCanOwn(SiteCoreOrPartDefBase siteDefBase, Faction faction, bool disallowNonHostileFactions, Predicate <Faction> extraFactionValidator)
 {
     if (siteDefBase == null)
     {
         Log.Error("Called FactionCanOwn() with null SiteDefBase.");
         return(false);
     }
     if (!siteDefBase.FactionCanOwn(faction))
     {
         return(false);
     }
     if (disallowNonHostileFactions && faction != null && !faction.HostileTo(Faction.OfPlayer))
     {
         return(false);
     }
     if (extraFactionValidator != null && !extraFactionValidator(faction))
     {
         return(false);
     }
     return(true);
 }