本文整理汇总了C#中Server.Map.GetTopSurface方法的典型用法代码示例。如果您正苦于以下问题:C# Map.GetTopSurface方法的具体用法?C# Map.GetTopSurface怎么用?C# Map.GetTopSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Map
的用法示例。
在下文中一共展示了Map.GetTopSurface方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetSurfaceTop
public static Point3D GetSurfaceTop(this IPoint3D p, Map map, bool items = true)
{
if (map == null || map == Map.Internal)
{
return Clone3D(p);
}
var point = ToPoint3D(p, Region.MaxZ);
var o = map.GetTopSurface(point);
if (o != null)
{
if (o is LandTile)
{
var t = (LandTile)o;
point = ToPoint3D(point, t.Z + t.Height);
}
else if (o is StaticTile)
{
var t = (StaticTile)o;
point = ToPoint3D(point, t.Z + TileData.ItemTable[t.ID].CalcHeight);
}
else if (o is Item && items)
{
var t = (Item)o;
point = ToPoint3D(point, t.Z + t.ItemData.CalcHeight);
}
}
return point;
}
示例2: GetSurfaceTop
public static Point3D GetSurfaceTop(this IPoint3D p, Map map, bool items = true)
{
if (map == null || map == Map.Internal)
{
return Clone3D(p);
}
Point3D point;
if (p is Item)
{
point = Clone3D(p, 0, 0, ((Item)p).ItemData.Height);
}
else if (p is Mobile)
{
point = Clone3D(p, 0, 0, 20);
}
else
{
point = Clone3D(p, 0, 0, 1);
}
object o = map.GetTopSurface(point);
if (o != null)
{
if (o is LandTile)
{
point = ToPoint3D(point, ((LandTile)o).Z + ((LandTile)o).Height + 1);
}
else if (o is StaticTile)
{
point = ToPoint3D(point, ((StaticTile)o).Z + ((StaticTile)o).Height + 1);
}
else if (o is Item && items)
{
point = ((Item)o).GetSurfaceTop();
}
}
return point;
}
示例3: GetSurfaceTop
public static Point3D GetSurfaceTop(this IPoint3D p, Map map, bool items = true)
{
if (map == null || map == Map.Internal)
{
return p.ToPoint3D();
}
Point3D point = Point3D.Zero;
if (p is Item)
{
point = p.Clone3D(0, 0, ((Item)p).ItemData.Height);
}
else if (p is Mobile)
{
point = p.Clone3D(0, 0, 20);
}
/*else
{
point = p.Clone3D(0, 0, 5);
}*/
object o = map.GetTopSurface(point);
if (o != null && o != p)
{
if (o is LandTile)
{
point.Z = ((LandTile)o).Z + ((LandTile)o).Height + 1;
}
else if (o is StaticTile)
{
point.Z = ((StaticTile)o).Z + ((StaticTile)o).Height + 1;
}
else if (o is Item && items)
{
point = ((Item)o).GetSurfaceTop();
}
}
return point;
}