本文整理汇总了C#中Server.Point3D.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# Point3D.ToString方法的具体用法?C# Point3D.ToString怎么用?C# Point3D.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Point3D
的用法示例。
在下文中一共展示了Point3D.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnResponse
public override void OnResponse( NetState sender, RelayInfo info )
{
Point3D toSet;
bool shouldSet, shouldSend;
switch ( info.ButtonID )
{
case 1: // Current location
{
toSet = 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 = Point3D.Zero;
shouldSet = false;
shouldSend = false;
break;
}
case 3: // Use values
{
TextRelay x = info.GetTextEntry( 0 );
TextRelay y = info.GetTextEntry( 1 );
TextRelay z = info.GetTextEntry( 2 );
toSet = new Point3D( x == null ? 0 : Utility.ToInt32( x.Text ), y == null ? 0 : Utility.ToInt32( y.Text ), z == null ? 0 : Utility.ToInt32( z.Text ) );
shouldSet = true;
shouldSend = true;
break;
}
default:
{
toSet = Point3D.Zero;
shouldSet = false;
shouldSend = true;
break;
}
}
if ( shouldSet )
{
try
{
CommandLogging.LogChangeProperty( m_Mobile, m_Object, m_Property.Name, toSet.ToString() );
m_Property.SetValue( m_Object, toSet, null );
PropertiesGump.OnValueChanged( m_Object, m_Property, m_Stack );
}
catch
{
m_Mobile.SendMessage( "An exception was caught. The property may not have changed." );
}
}
if ( shouldSend )
m_Mobile.SendGump( new PropertiesGump( m_Mobile, m_Object, m_Stack, m_List, m_Page ) );
}
示例2: GetAnchorName
private object GetAnchorName()
{
if(m_Anchor == null)
return "None";
if(m_Anchor is Mobile)
return ((Mobile)m_Anchor).Name;
if(m_Anchor is Item)
{
if(((Item)m_Anchor).Name != null)
return ((Item)m_Anchor).Name;
return ((Item)m_Anchor).LabelNumber;
}
if(m_Anchor is StaticTarget)
return String.Format("{0} {1}", ((StaticTarget)m_Anchor).Name, ((StaticTarget)m_Anchor).Location.ToString());
if(m_Anchor is LandTarget)
return String.Format("{0} {1}", ((LandTarget)m_Anchor).Name, ((LandTarget)m_Anchor).Location.ToString());
Point3D p = new Point3D(m_Anchor);
return p.ToString();
}
示例3: GetSextantLocation
public string GetSextantLocation(Point3D pnt)
{
int xLong = 0, yLat = 0;
int xMins = 0, yMins = 0;
bool xEast = false, ySouth = false;
if (Sextant.Format(pnt, m_Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
return String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
return pnt.ToString();
}
示例4: FormatSextant
public static string FormatSextant(Point3D p, Map map)
{
int xLong = 0, yLat = 0;
int xMins = 0, yMins = 0;
bool xEast = false, ySouth = false;
if (Sextant.Format(p, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth))
{
return String.Format("{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W");
}
return p.ToString();
}