Files
RobustToolbox/Robust.Shared/GameObjects/Components/Transform/SnapGridComponent.cs
T
AcruidandGitHub 122acc5fd5 SnapGridComponent Removal (#1720)
* Removed SnapGridOffset, there is only center now.

* SnapGridComponent methods are now static.

* Removed SnapGridComponent.OnPositionChanged.

* Refactored static functions off SnapGridComponent to MapGrid.
Refactored away usages of SnapGridComponent.Position.

* Added Transform.Anchored for checking if an entity is a tile entity.
More refactoring for static MapGrid functions.

* Static snapgrid methods on MapGrid are no longer static.

* Removed IMapGrid.SnapSize, it is now always equal to the IMapGrid.TileSize.

* Add setter to ITransformComponent.Anchored.
Removed direct references to SnapGridComponent from content.

* Grid functions now deal with EntityUids instead of SnapGridComponents.
Began renaming public API functions from SnapGrid to Anchor.

* Add some unit tests.

* SnapGridComponent now anchors itself in startup, instead of Initialize (sending directed events in init is an error).
2021-04-28 10:24:11 -07:00

25 lines
654 B
C#

using Robust.Shared.Map;
using Robust.Shared.Maths;
namespace Robust.Shared.GameObjects
{
/// <summary>
/// Makes it possible to look this entity up with the snap grid.
/// </summary>
internal class SnapGridComponent : Component
{
/// <inheritdoc />
public sealed override string Name => "SnapGrid";
/// <summary>
/// GridId the last time this component was moved.
/// </summary>
internal GridId LastGrid = GridId.Invalid;
/// <summary>
/// TileIndices the last time this component was moved.
/// </summary>
internal Vector2i LastTileIndices;
}
}