本文整理匯總了C#中Server.Point2D.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# Point2D.ToString方法的具體用法?C# Point2D.ToString怎麽用?C# Point2D.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Point2D
的用法示例。
在下文中一共展示了Point2D.ToString方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: OnResponse
public override void OnResponse( NetState sender, RelayInfo info )
{
Point2D toSet;
bool shouldSet, shouldSend;
switch ( info.ButtonID )
{
case 1: // Current location
{
toSet = new Point2D( m_Mobile.Location );
shouldSet = true;
shouldSend = true;
break;
}
case 2: // Pick location
{
m_Mobile.Target = new InternalTarget( m_Property, m_Mobile, m_Object, m_Stack, m_Page, m_List );
toSet = Point2D.Zero;
shouldSet = false;
shouldSend = false;
break;
}
case 3: // Use values
{
TextRelay x = info.GetTextEntry( 0 );
TextRelay y = info.GetTextEntry( 1 );
toSet = new Point2D( x == null ? 0 : Utility.ToInt32( x.Text ), y == null ? 0 : Utility.ToInt32( y.Text ) );
shouldSet = true;
shouldSend = true;
break;
}
default:
{
toSet = Point2D.Zero;
shouldSet = false;
shouldSend = true;
break;
}
}
if ( shouldSet )
{
try
{
CommandLogging.LogChangeProperty(m_Mobile, m_Object, m_Property.Name, m_Property.GetValue(m_Object, null).ToString(), toSet.ToString());
m_Property.SetValue( m_Object, toSet, null );
}
catch
{
m_Mobile.SendMessage( "An exception was caught. The property may not have changed." );
}
}
if ( shouldSend )
m_Mobile.SendGump( new XmlPropertiesGump( m_Mobile, m_Object, m_Stack, m_List, m_Page ) );
}