Files
tbd-station-14/Content.Shared/Parallax/Biomes/BiomeComponent.cs
metalgearsloth 816ee2e1ab Gateway destinations (#21040)
* Gateway generation

* Gateway stuff

* gatewehs

* mercenaries

* play area

* Range fixes and tweaks

* weh

* Gateway UI polish

* Lots of fixes

* Knock some items off

* Fix dungeon spawning

Realistically we should probably be using a salvage job.

* wahwah

* wehvs

* expression

* weh

* eee

* a

* a

* WEH

* frfr

* Gatwey

* Fix gateway windows

* Fix gateway windows

* a

* a

* Better layer masking

* a

* a

* Noise fixes

* a

* Fix fractal calculations

* a

* More fixes

* Fixes

* Add layers back in

* Fixes

* namespaces and ftl

* Other TODO

* Fix distance

* Cleanup

* Fix test
2023-11-14 19:23:40 -07:00

76 lines
2.8 KiB
C#

using Content.Shared.Parallax.Biomes.Layers;
using Content.Shared.Parallax.Biomes.Markers;
using Robust.Shared.GameStates;
using Robust.Shared.Noise;
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
{
[ViewVariables(VVAccess.ReadWrite), DataField("seed")]
[AutoNetworkedField]
public int Seed = -1;
/// <summary>
/// The underlying entity, decal, and tile layers for the biome.
/// </summary>
[DataField("layers")]
[AutoNetworkedField]
public List<IBiomeLayer> Layers = new();
/// <summary>
/// Templates to use for <see cref="Layers"/>. Optional as this can be set elsewhere.
/// </summary>
/// <remarks>
/// This is really just here for prototype reload support.
/// </remarks>
[ViewVariables(VVAccess.ReadWrite),
DataField("template", customTypeSerializer: typeof(PrototypeIdSerializer<BiomeTemplatePrototype>))]
public string? Template;
/// <summary>
/// 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]
/// </summary>
[DataField("modifiedTiles")]
public Dictionary<Vector2i, HashSet<Vector2i>> ModifiedTiles = new();
/// <summary>
/// Decals that have been loaded as a part of this biome.
/// </summary>
[DataField("decals")]
public Dictionary<Vector2i, Dictionary<uint, Vector2i>> LoadedDecals = new();
[DataField("entities")]
public Dictionary<Vector2i, Dictionary<EntityUid, Vector2i>> LoadedEntities = new();
/// <summary>
/// Currently active chunks
/// </summary>
[DataField("loadedChunks")]
public HashSet<Vector2i> LoadedChunks = new();
#region Markers
/// <summary>
/// Work out entire marker tiles in advance but only load the entities when in range.
/// </summary>
[DataField("pendingMarkers")]
public Dictionary<Vector2i, Dictionary<string, List<Vector2i>>> PendingMarkers = new();
/// <summary>
/// Track what markers we've loaded already to avoid double-loading.
/// </summary>
[DataField("loadedMarkers", customTypeSerializer:typeof(PrototypeIdDictionarySerializer<HashSet<Vector2i>, BiomeMarkerLayerPrototype>))]
public Dictionary<string, HashSet<Vector2i>> LoadedMarkers = new();
[DataField("markerLayers", customTypeSerializer: typeof(PrototypeIdListSerializer<BiomeMarkerLayerPrototype>))]
public List<string> MarkerLayers = new();
#endregion
}