modernuo/Projects/Server/Targeting/StaticTarget.cs

46 lines
1.2 KiB
C#
Raw Permalink Normal View History

namespace Server.Targeting;
public class StaticTarget : IPoint3D
2020-08-25 18:53:35 -07:00
{
private Point3D m_Location;
2020-08-25 18:53:35 -07:00
public StaticTarget(Point3D location, int itemID)
{
m_Location = location;
ItemID = itemID & TileData.MaxItemValue;
m_Location.Z += TileData.ItemTable[ItemID].CalcHeight;
}
2020-08-25 18:53:35 -07:00
public StaticTarget(Point3D location, int itemID, int hue)
{
m_Location = location;
ItemID = itemID & TileData.MaxItemValue;
m_Location.Z += TileData.ItemTable[ItemID].CalcHeight;
Hue = hue;
}
[CommandProperty(AccessLevel.Counselor)]
public Point3D Location => m_Location;
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public string Name => TileData.ItemTable[ItemID].Name;
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public TileFlag Flags => TileData.ItemTable[ItemID].Flags;
2020-08-25 18:53:35 -07:00
[CommandProperty(AccessLevel.Counselor)]
public int ItemID { get; }
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;
[CommandProperty(AccessLevel.Counselor)]
public int Hue { get; }
2020-08-25 18:53:35 -07:00
}