當前位置: 首頁>>代碼示例>>C#>>正文


C# Guild.IsLeader方法代碼示例

本文整理匯總了C#中Server.Guilds.Guild.IsLeader方法的典型用法代碼示例。如果您正苦於以下問題:C# Guild.IsLeader方法的具體用法?C# Guild.IsLeader怎麽用?C# Guild.IsLeader使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.Guilds.Guild的用法示例。


在下文中一共展示了Guild.IsLeader方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GuildGump

        public GuildGump( Mobile beholder, Guild guild )
            : base(20, 30)
        {
            m_Mobile = beholder;
            m_Guild = guild;

            Dragable = false;

            AddPage( 0 );
            AddBackground( 0, 0, 550, 400, 5054 );
            AddBackground( 10, 10, 530, 380, 3000 );

            AddHtml( 20, 15, 200, 35, guild.Name, false, false );

            Mobile leader = guild.Leader;

            if ( leader != null )
            {
                string leadTitle;

                if ( (leadTitle = leader.GuildTitle) != null && (leadTitle = leadTitle.Trim()).Length > 0 )
                    leadTitle += ": ";
                else
                    leadTitle = "";

                string leadName;

                if ( (leadName = leader.Name) == null || (leadName = leadName.Trim()).Length <= 0 )
                    leadName = "(empty)";

                AddHtml( 220, 15, 250, 35, leadTitle + leadName, false, false );
            }

            AddButton( 20, 50, 4005, 4007, 1, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 55, 50, 100, 20, 1013022, false, false ); // Loyal to

            Mobile fealty = beholder.GuildFealty;

            if ( fealty == null || !guild.IsMember( fealty ) )
                fealty = leader;

            if ( fealty == null )
                fealty = beholder;

            string fealtyName;

            if ( fealty == null || (fealtyName = fealty.Name) == null || (fealtyName = fealtyName.Trim()).Length <= 0 )
                fealtyName = "(empty)";

            if ( beholder == fealty )
                AddHtmlLocalized( 55, 70, 470, 20, 1018002, false, false ); // yourself
            else
                AddHtml( 55, 70, 470, 20, fealtyName, false, false );

            AddButton( 215, 50, 4005, 4007, 2, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 250, 50, 170, 20, 1013023, false, false ); // Display guild abbreviation
            AddHtmlLocalized( 250, 70, 50, 20, beholder.DisplayGuildTitle ? 1011262 : 1011263, false, false ); // on/off

            AddButton( 20, 100, 4005, 4007, 3, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 55, 100, 470, 30, 1011086, false, false ); // View the current roster.

            AddButton( 20, 130, 4005, 4007, 4, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 55, 130, 470, 30, 1011085, false, false ); // Recruit someone into the guild.

            if ( guild.Candidates.Count > 0 )
            {
                AddButton( 20, 160, 4005, 4007, 5, GumpButtonType.Reply, 0 );
                AddHtmlLocalized( 55, 160, 470, 30, 1011093, false, false ); // View list of candidates who have been sponsored to the guild.
            }
            else
            {
                AddImage( 20, 160, 4020 );
                AddHtmlLocalized( 55, 160, 470, 30, 1013031, false, false ); // There are currently no candidates for membership.
            }

            AddButton( 20, 220, 4005, 4007, 6, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 55, 220, 470, 30, 1011087, false, false ); // View the guild's charter.

            AddButton( 20, 250, 4005, 4007, 7, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 55, 250, 470, 30, 1011092, false, false ); // Resign from the guild.

            AddButton( 20, 280, 4005, 4007, 8, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 55, 280, 470, 30, 1011095, false, false ); // View list of guilds you are at war with.

            if ( guild.IsLeader( beholder ) )
            {
                AddButton( 20, 310, 4005, 4007, 9, GumpButtonType.Reply, 0 );
                AddHtmlLocalized( 55, 310, 470, 30, 1011094, false, false ); // Access guildmaster functions.
            }
            else
            {
                AddImage( 20, 310, 4020 );
                AddHtmlLocalized( 55, 310, 470, 30, 1018013, false, false ); // Reserved for guildmaster
            }

            AddButton( 20, 360, 4005, 4007, 0, GumpButtonType.Reply, 0 );
            AddHtmlLocalized( 55, 360, 470, 30, 1011441, false, false ); // EXIT
        }
開發者ID:FreeReign,項目名稱:Rebirth-Repack,代碼行數:98,代碼來源:GuildGump.cs

示例2: BadLeader

        public static bool BadLeader( Mobile m, Guild g )
        {
            if ( m.Deleted || g.Disbanded || !g.IsLeader( m ) )
                return true;

            Item stone = g.Guildstone;

            return ( stone == null || stone.Deleted || !m.InRange( stone.GetWorldLocation(), 2 ) );
        }
開發者ID:FreeReign,項目名稱:Rebirth-Repack,代碼行數:9,代碼來源:GuildGump.cs


注:本文中的Server.Guilds.Guild.IsLeader方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。