本文整理匯總了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 );
}
}