mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-16 15:22:27 +02:00
* 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).
25 lines
654 B
C#
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;
|
|
}
|
|
}
|