Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removes obsolete MapManager methods #1805

Merged
merged 1 commit into from
May 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions OpenDreamRuntime/DreamMapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using OpenDreamRuntime.Procs;
using OpenDreamRuntime.Rendering;
using OpenDreamShared.Dream;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Utility;
Expand All @@ -23,6 +24,7 @@ public sealed class DreamMapManager : IDreamMapManager {

// Set in Initialize
private ServerAppearanceSystem _appearanceSystem = default!;
private SharedMapSystem _mapSystem = default!;

public Vector2i Size { get; private set; }
public int Levels => _levels.Count;
Expand All @@ -38,6 +40,7 @@ public sealed class DreamMapManager : IDreamMapManager {

public void Initialize() {
_appearanceSystem = _entitySystemManager.GetEntitySystem<ServerAppearanceSystem>();
_mapSystem = _entitySystemManager.GetEntitySystem<MapSystem>();

DreamObjectDefinition worldDefinition = _objectTree.World.ObjectDefinition;

Expand Down Expand Up @@ -78,7 +81,7 @@ public void UpdateTiles() {
tiles.Add( (tileUpdate.Key, tileUpdate.Value) );
}

level.Grid.SetTiles(tiles);
_mapSystem.SetTiles(level.Grid, tiles);
level.QueuedTileUpdates.Clear();
}
}
Expand Down Expand Up @@ -251,9 +254,9 @@ public void SetZLevels(int levels) {

for (int z = Levels + 1; z <= levels; z++) {
MapId mapId = new(z);
_mapManager.CreateMap(mapId);
_mapSystem.CreateMap(mapId);

MapGridComponent grid = _mapManager.CreateGrid(mapId);
var grid = _mapManager.CreateGridEntity(mapId);
Level level = new Level(z, grid, defaultArea, Size);
_levels.Add(level);

Expand Down Expand Up @@ -364,11 +367,11 @@ public EntityUid GetZLevelEntity(int z) {
public interface IDreamMapManager {
public sealed class Level {
public readonly int Z;
public readonly MapGridComponent Grid;
public readonly Entity<MapGridComponent> Grid;
public Cell[,] Cells;
public readonly Dictionary<Vector2i, Tile> QueuedTileUpdates = new();

public Level(int z, MapGridComponent grid, DreamObjectArea area, Vector2i size) {
public Level(int z, Entity<MapGridComponent> grid, DreamObjectArea area, Vector2i size) {
Z = z;
Grid = grid;

Expand Down
Loading