当前位置: 首页>>代码示例>>C#>>正文


C# Point3D.ToString方法代码示例

本文整理汇总了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 ) );
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:64,代码来源:SetPoint3DGump.cs

示例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();
		}
开发者ID:Crome696,项目名称:ServUO,代码行数:26,代码来源:WispOrb.cs

示例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();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:11,代码来源:CharybdisSpawner.cs

示例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();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:13,代码来源:MaginciaLottoSystem.cs


注:本文中的Server.Point3D.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。