using System.Linq;
using Content.Shared.Atmos;
using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
namespace Content.Shared.Pinpointer;
///
/// Used to store grid data to be used for UIs.
///
[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 Chunks = new();
///
/// List of station beacons.
///
[ViewVariables]
public Dictionary Beacons = new();
}
[Serializable, NetSerializable]
public sealed class NavMapChunk(Vector2i origin)
{
///
/// The chunk origin
///
[ViewVariables]
public readonly Vector2i Origin = origin;
///
/// Array containing the chunk's data. The
///
[ViewVariables]
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,
}