CatStation/Content.Server/Station/Systems/StationBiomeSystem.cs
Whatstone f42f8df6d1
Cleanup: ProtoMan Part 2 - remove Client and Server EntitySystem IPrototypeManager instances (#44416)
* Remove all IPrototypeManager instances

* Remove redundant IComponentFactory instances too

* Found some stragglers

* DestructibleSystem.PrototypeManager: no dependency

* not based
2026-06-29 21:33:56 +00:00

30 lines
1,007 B
C#

using Content.Server.Parallax;
using Content.Server.Station.Components;
using Content.Server.Station.Events;
namespace Content.Server.Station.Systems;
public sealed partial class StationBiomeSystem : EntitySystem
{
[Dependency] private BiomeSystem _biome = default!;
[Dependency] private StationSystem _station = default!;
[Dependency] private SharedMapSystem _map = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<StationBiomeComponent, StationPostInitEvent>(OnStationPostInit);
}
private void OnStationPostInit(Entity<StationBiomeComponent> map, ref StationPostInitEvent args)
{
var station = _station.GetLargestGrid(map.Owner);
if (station == null)
return;
var mapId = Transform(station.Value).MapID;
var mapUid = _map.GetMapOrInvalid(mapId);
_biome.EnsurePlanet(mapUid, ProtoMan.Index(map.Comp.Biome), map.Comp.Seed, mapLight: map.Comp.MapLightColor);
}
}