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<(NavMapChunkType, Vector2i), NavMapChunk> Chunks = new(); /// /// List of station beacons. /// [ViewVariables] public HashSet Beacons = new(); } [Serializable, NetSerializable] public sealed class NavMapChunk { /// /// The chunk origin /// public readonly Vector2i Origin; /// /// Bitmask for tiles, 1 for occupied and 0 for empty. There is a bitmask for each cardinal direction, /// representing each edge of the tile, in case the entities inside it do not entirely fill it /// public Dictionary TileData; /// /// The last game tick that the chunk was updated /// [NonSerialized] public GameTick LastUpdate; public NavMapChunk(Vector2i origin) { Origin = origin; TileData = new() { [AtmosDirection.North] = 0, [AtmosDirection.East] = 0, [AtmosDirection.South] = 0, [AtmosDirection.West] = 0, }; } } public enum NavMapChunkType : byte { Invalid, Floor, Wall, Airlock, }