using Content.Shared.Parallax.Biomes.Layers;
using Content.Shared.Parallax.Biomes.Markers;
using Robust.Shared.GameStates;
using Robust.Shared.Noise;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
namespace Content.Shared.Parallax.Biomes;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), Access(typeof(SharedBiomeSystem))]
public sealed partial class BiomeComponent : Component
{
///
/// Do we load / deload.
///
[DataField, ViewVariables(VVAccess.ReadWrite), Access(Other = AccessPermissions.ReadWriteExecute)]
public bool Enabled = true;
[ViewVariables(VVAccess.ReadWrite), DataField("seed")]
[AutoNetworkedField]
public int Seed = -1;
///
/// The underlying entity, decal, and tile layers for the biome.
///
[DataField("layers")]
[AutoNetworkedField]
public List Layers = new();
///
/// Templates to use for . Optional as this can be set elsewhere.
///
///
/// This is really just here for prototype reload support.
///
[ViewVariables(VVAccess.ReadWrite),
DataField("template", customTypeSerializer: typeof(PrototypeIdSerializer))]
public string? Template;
///
/// If we've already generated a tile and couldn't deload it then we won't ever reload it in future.
/// Stored by [Chunkorigin, Tiles]
///
[DataField("modifiedTiles")]
public Dictionary> ModifiedTiles = new();
///
/// Decals that have been loaded as a part of this biome.
///
[DataField("decals")]
public Dictionary> LoadedDecals = new();
[DataField("entities")]
public Dictionary> LoadedEntities = new();
///
/// Currently active chunks
///
[DataField("loadedChunks")]
public HashSet LoadedChunks = new();
#region Markers
///
/// Work out entire marker tiles in advance but only load the entities when in range.
///
[DataField("pendingMarkers")]
public Dictionary>> PendingMarkers = new();
///
/// Track what markers we've loaded already to avoid double-loading.
///
[DataField("loadedMarkers", customTypeSerializer:typeof(PrototypeIdDictionarySerializer, BiomeMarkerLayerPrototype>))]
public Dictionary> LoadedMarkers = new();
[DataField]
public HashSet> MarkerLayers = new();
///
/// One-tick forcing of marker layers to bulldoze any entities in the way.
///
[DataField]
public HashSet> ForcedMarkerLayers = new();
#endregion
}