Пример #1
0
 private static bool FactionCanOwn(SiteDefBase siteDefBase, Faction faction, bool disallowAlliedFactions, Predicate <Faction> extraFactionValidator)
 {
     if (siteDefBase == null)
     {
         Log.Error("Called FactionCanOwn() with null SiteDefBase.");
         return(false);
     }
     return(siteDefBase.FactionCanOwn(faction) && (!disallowAlliedFactions || faction == null || faction.HostileTo(Faction.OfPlayer)) && (extraFactionValidator == null || extraFactionValidator(faction)));
 }
 private static bool FactionCanOwn(SiteDefBase siteDefBase, Faction faction, bool disallowAlliedFactions, Predicate <Faction> extraFactionValidator)
 {
     if (siteDefBase == null)
     {
         Log.Error("Called FactionCanOwn() with null SiteDefBase.");
         return(false);
     }
     if (!siteDefBase.FactionCanOwn(faction))
     {
         return(false);
     }
     if (disallowAlliedFactions && faction != null && !faction.HostileTo(Faction.OfPlayer))
     {
         return(false);
     }
     if (extraFactionValidator != null && !extraFactionValidator(faction))
     {
         return(false);
     }
     return(true);
 }