/// <summary>
        /// Retrieve the guild object for the given guild group.
        /// </summary>
        /// <param name="guildGroup"></param>
        /// <param name="buildingFactionId">Specify this to ensure only the temple of matching Divine is returned</param>
        /// <returns>Guild object</returns>
        public Guild GetGuild(FactionFile.GuildGroups guildGroup, int buildingFactionId = 0)
        {
            Guild guild;

            memberships.TryGetValue(guildGroup, out guild);

            if (guildGroup == FactionFile.GuildGroups.HolyOrder && buildingFactionId > 0)
            {
                if (guild != null)
                {
                    Temple.Divines deity  = Temple.GetDivine(buildingFactionId);
                    Temple         temple = (Temple)guild;
                    if (temple.Deity == deity)
                    {
                        return(guild);
                    }
                }
                return(templeNotMember);
            }
            else if (guildGroup == FactionFile.GuildGroups.KnightlyOrder && buildingFactionId > 0)
            {
                if (guild != null)
                {
                    KnightlyOrder.Orders order         = KnightlyOrder.GetOrder(buildingFactionId);
                    KnightlyOrder        knightlyOrder = (KnightlyOrder)guild;
                    if (knightlyOrder.Order == order)
                    {
                        return(guild);
                    }
                }
                return(guildNotMember);
            }
            return((guild != null) ? guild : guildNotMember);
        }
        private Guild CreateGuildObj(FactionFile.GuildGroups guildGroup, int variant = 0)
        {
            switch (guildGroup)
            {
            case FactionFile.GuildGroups.FightersGuild:
                return(new FightersGuild());

            case FactionFile.GuildGroups.MagesGuild:
                return(new MagesGuild());

            case FactionFile.GuildGroups.HolyOrder:
                return(new Temple(Temple.GetDivine(variant)));

            case FactionFile.GuildGroups.KnightlyOrder:
                return(new KnightlyOrder(KnightlyOrder.GetOrder(variant)));

            case FactionFile.GuildGroups.GeneralPopulace:
                return(new ThievesGuild());

            case FactionFile.GuildGroups.DarkBrotherHood:
                return(new DarkBrotherhood());

            default:
                Type guildType;
                if (customGuilds.TryGetValue(guildGroup, out guildType))
                {
                    return((Guild)Activator.CreateInstance(guildType));
                }
                else
                {
                    return(null);
                }
            }
        }
Exemple #3
0
 public TempleMacroDataSource(Temple guild) : base(guild)
 {
     parent = guild;
 }