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


C# TextDefinition.ToString方法代碼示例

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


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

示例1: AddBuffPacket

        public AddBuffPacket( Mobile mob, BuffIcon iconID, int titleCliloc, int secondaryCliloc, TextDefinition args, TimeSpan length )
            : base(0xDF)
        {
            bool hasArgs = (args != null);

            this.EnsureCapacity( (hasArgs ? (48 + args.ToString().Length * 2): 44) );
            m_Stream.Write( (int)mob.Serial );

            m_Stream.Write( (short)iconID );	//ID
            m_Stream.Write( (short)0x1 );	//Type 0 for removal. 1 for add 2 for Data

            m_Stream.Fill( 4 );

            m_Stream.Write( (short)iconID );	//ID
            m_Stream.Write( (short)0x01 );	//Type 0 for removal. 1 for add 2 for Data

            m_Stream.Fill( 4 );

            if( length < TimeSpan.Zero )
                length = TimeSpan.Zero;

            m_Stream.Write( (short)length.TotalSeconds );	//Time in seconds

            m_Stream.Fill( 3 );
            m_Stream.Write( (int)titleCliloc );
            m_Stream.Write( (int)secondaryCliloc );

            if( !hasArgs )
            {
                //m_Stream.Fill( 2 );
                m_Stream.Fill( 10 );
            }
            else
            {
                m_Stream.Fill( 4 );
                m_Stream.Write( (short)0x1 );	//Unknown -> Possibly something saying 'hey, I have more data!'?
                m_Stream.Fill( 2 );

                //m_Stream.WriteLittleUniNull( "\t#1018280" );
                m_Stream.WriteLittleUniNull( String.Format( "\t{0}", args.ToString() ) );

                m_Stream.Write( (short)0x1 );	//Even more Unknown -> Possibly something saying 'hey, I have more data!'?
                m_Stream.Fill( 2 );
            }
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:45,代碼來源:BuffIcons.cs


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