mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
32 lines
799 B
C#
32 lines
799 B
C#
using Robust.Shared.Map;
|
|
|
|
namespace Robust.Client.Placement.Modes
|
|
{
|
|
public sealed class PlaceNearby : PlacementMode
|
|
{
|
|
public PlaceNearby(PlacementManager pMan) : base(pMan) { }
|
|
|
|
public override bool RangeRequired => true;
|
|
|
|
public override void AlignPlacementMode(ScreenCoordinates mouseScreen)
|
|
{
|
|
MouseCoords = ScreenToCursorGrid(mouseScreen);
|
|
CurrentTile = GetTileRef(MouseCoords);
|
|
}
|
|
|
|
public override bool IsValidPosition(EntityCoordinates position)
|
|
{
|
|
if (pManager.CurrentPermission!.IsTile)
|
|
{
|
|
return false;
|
|
}
|
|
else if (!RangeCheck(position))
|
|
{
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|
|
}
|