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


C# Faction.IsCommander方法代碼示例

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


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

示例1: FactionStoneGump

        public FactionStoneGump( PlayerMobile from, Faction faction )
            : base(20, 30)
        {
            m_From = from;
            m_Faction = faction;

            AddPage( 0 );

            AddBackground( 0, 0, 550, 440, 5054 );
            AddBackground( 10, 10, 530, 420, 3000 );

            #region General
            AddPage( 1 );

            AddHtmlText( 20, 30, 510, 20, faction.Definition.Header, false, false );

            AddHtmlLocalized( 20, 60, 100, 20, 1011429, false, false ); // Led By :
            AddHtml( 125, 60, 200, 20, faction.Commander != null ? faction.Commander.Name : "Nobody", false, false );

            AddHtmlLocalized( 20, 80, 100, 20, 1011457, false, false ); // Tithe rate :
            if ( faction.Tithe >= 0 && faction.Tithe <= 100 && ( faction.Tithe % 10 ) == 0 )
            {
                AddHtmlLocalized( 125, 80, 350, 20, 1011480 + ( faction.Tithe / 10 ), false, false );
            }
            else
            {
                AddHtml( 125, 80, 350, 20, faction.Tithe + "%", false, false );
            }

            AddHtmlLocalized( 20, 100, 100, 20, 1011458, false, false ); // Traps placed :
            AddHtml( 125, 100, 50, 20, faction.Traps.Count.ToString(), false, false );

            AddHtmlLocalized( 55, 225, 200, 20, 1011428, false, false ); // VOTE FOR LEADERSHIP
            AddButton( 20, 225, 4005, 4007, ToButtonID( 0, 0 ), GumpButtonType.Reply, 0 );

            AddHtmlLocalized( 55, 150, 100, 20, 1011430, false, false ); // CITY STATUS
            AddButton( 20, 150, 4005, 4007, 0, GumpButtonType.Page, 2 );

            AddHtmlLocalized( 55, 175, 100, 20, 1011444, false, false ); // STATISTICS
            AddButton( 20, 175, 4005, 4007, 0, GumpButtonType.Page, 4 );

            bool isMerchantQualified = MerchantTitles.HasMerchantQualifications( from );

            PlayerState pl = PlayerState.Find( from );

            if ( pl != null && pl.MerchantTitle != MerchantTitle.None )
            {
                AddHtmlLocalized( 55, 200, 250, 20, 1011460, false, false ); // UNDECLARE FACTION MERCHANT
                AddButton( 20, 200, 4005, 4007, ToButtonID( 1, 0 ), GumpButtonType.Reply, 0 );
            }
            else if ( isMerchantQualified )
            {
                AddHtmlLocalized( 55, 200, 250, 20, 1011459, false, false ); // DECLARE FACTION MERCHANT
                AddButton( 20, 200, 4005, 4007, 0, GumpButtonType.Page, 5 );
            }
            else
            {
                AddHtmlLocalized( 55, 200, 250, 20, 1011467, false, false ); // MERCHANT OPTIONS
                AddImage( 20, 200, 4020 );
            }

            AddHtmlLocalized( 55, 250, 300, 20, 1011461, false, false ); // COMMANDER OPTIONS
            if ( faction.IsCommander( from ) )
            {
                AddButton( 20, 250, 4005, 4007, 0, GumpButtonType.Page, 6 );
            }
            else
            {
                AddImage( 20, 250, 4020 );
            }

            AddHtmlLocalized( 55, 275, 300, 20, 1011426, false, false ); // LEAVE THIS FACTION
            AddButton( 20, 275, 4005, 4007, ToButtonID( 0, 1 ), GumpButtonType.Reply, 0 );

            AddHtmlLocalized( 55, 300, 200, 20, 1011441, false, false ); // EXIT
            AddButton( 20, 300, 4005, 4007, 0, GumpButtonType.Reply, 0 );
            #endregion

            #region City Status
            AddPage( 2 );

            AddHtmlLocalized( 20, 30, 250, 20, 1011430, false, false ); // CITY STATUS

            TownCollection towns = Town.Towns;

            for ( int i = 0; i < towns.Count; ++i )
            {
                Town town = towns[i];

                AddHtmlText( 40, 55 + ( i * 30 ), 150, 20, town.Definition.TownName, false, false );

                if ( town.Owner == null )
                {
                    AddHtmlLocalized( 200, 55 + ( i * 30 ), 150, 20, 1011462, false, false ); // : Neutral
                }
                else
                {
                    AddHtmlLocalized( 200, 55 + ( i * 30 ), 150, 20, town.Owner.Definition.OwnerLabel, false, false );

                    BaseMonolith monolith = town.Monolith;
//.........這裏部分代碼省略.........
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:101,代碼來源:FactionStoneGump.cs


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