当前位置: 首页>>代码示例>>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;未经允许,请勿转载。