modernuo/Projects/Server/Targeting/LandTarget.cs

39 lines
1 KiB
C#
Raw Permalink Normal View History

namespace Server.Targeting;
public class LandTarget : IPoint3D
2020-08-25 18:53:35 -07:00
{
private Point3D m_Location;
public LandTarget(Point3D location, Map map)
2020-08-25 18:53:35 -07:00
{
m_Location = location;
2020-08-25 18:53:35 -07:00
if (map != null)
2020-08-25 18:53:35 -07:00
{
m_Location.Z = map.GetAverageZ(m_Location.X, m_Location.Y);
TileID = map.Tiles.GetLandTile(m_Location.X, m_Location.Y).ID & TileData.MaxLandValue;
2020-08-25 18:53:35 -07:00
}
}
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public string Name => TileData.LandTable[TileID].Name;
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public TileFlag Flags => TileData.LandTable[TileID].Flags;
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public int TileID { get; }
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public Point3D Location => m_Location;
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public int X => m_Location.X;
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public int Y => m_Location.Y;
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public int Z => m_Location.Z;
2020-08-25 18:53:35 -07:00
}