using System.Linq;
using Content.Shared.Atmos;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
namespace Content.Shared.Pinpointer;
/// <summary>
/// Used to store grid data to be used for UIs.
/// </summary>
[RegisterComponent, NetworkedComponent]
public sealed partial class NavMapComponent : Component
{
/*
* Don't need DataFields as this can be reconstructed
*/
/// Bitmasks that represent chunked tiles.
[ViewVariables]
public Dictionary<Vector2i, NavMapChunk> Chunks = new();
/// List of station beacons.
public Dictionary<NetEntity, SharedNavMapSystem.NavMapBeacon> Beacons = new();
}
[Serializable, NetSerializable]
public sealed class NavMapChunk(Vector2i origin)
/// The chunk origin
public readonly Vector2i Origin = origin;
/// Array containing the chunk's data. The
public int[] TileData = new int[SharedNavMapSystem.ArraySize];
/// The last game tick that the chunk was updated
[NonSerialized]
public GameTick LastUpdate;
public enum NavMapChunkType : byte
// Values represent bit shift offsets when retrieving data in the tile array.
Invalid = byte.MaxValue,
Floor = 0, // I believe floors have directional information for diagonal tiles?
Wall = SharedNavMapSystem.Directions,
Airlock = 2 * SharedNavMapSystem.Directions,