]> git.deb.at Git - rhonda/impostor.git/commitdiff
Make vent data initialization much cleaner
authorjs6pak <kubastaron@hotmail.com>
Sat, 10 Apr 2021 15:14:17 +0000 (17:14 +0200)
committerjs6pak <kubastaron@hotmail.com>
Sat, 10 Apr 2021 15:14:17 +0000 (17:14 +0200)
25 files changed:
src/Impostor.Api/Events/Game/Player/IPlayerEnterVentEvent.cs
src/Impostor.Api/Events/Game/Player/IPlayerExitVentEvent.cs
src/Impostor.Api/Events/Game/Player/IPlayerVentEvent.cs
src/Impostor.Api/Extensions/DictionaryExtensions.cs [new file with mode: 0644]
src/Impostor.Api/Innersloth/IVent.cs [new file with mode: 0644]
src/Impostor.Api/Innersloth/Maps/AirshipData.cs
src/Impostor.Api/Innersloth/Maps/IMapData.cs [new file with mode: 0644]
src/Impostor.Api/Innersloth/Maps/MapData.cs [deleted file]
src/Impostor.Api/Innersloth/Maps/MiraData.cs
src/Impostor.Api/Innersloth/Maps/PolusData.cs
src/Impostor.Api/Innersloth/Maps/SkeldData.cs
src/Impostor.Api/Innersloth/Maps/Vents/AirshipVent.cs
src/Impostor.Api/Innersloth/Maps/Vents/MiraVent.cs
src/Impostor.Api/Innersloth/Maps/Vents/PolusVent.cs
src/Impostor.Api/Innersloth/Maps/Vents/SkeldVent.cs
src/Impostor.Api/Innersloth/Vent.cs [deleted file]
src/Impostor.Plugins.Example/Handlers/PlayerEventListener.cs
src/Impostor.Server/Events/Game/Player/PlayerEnterVentEvent.cs
src/Impostor.Server/Events/Game/Player/PlayerExitVentEvent.cs
src/Impostor.Server/Events/Game/Player/PlayerVentEvent.cs
src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerAirshipStatus.cs
src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerMiraShipStatus.cs
src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerPolusShipStatus.cs
src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerShipStatus.cs
src/Impostor.Server/Net/Inner/Objects/ShipStatus/InnerSkeldShipStatus.cs

index dddcb3bf8bfe0a794a9f9f18ed5c0bd50945ede6..fac832b7d00e41a973922144c908d01087c51d4f 100644 (file)
@@ -2,11 +2,14 @@ using Impostor.Api.Innersloth;
 
 namespace Impostor.Api.Events.Player
 {
+    /// <summary>
+    ///     Called whenever a player enters a vent.
+    /// </summary>
     public interface IPlayerEnterVentEvent : IPlayerEvent
     {
         /// <summary>
-        ///     Gets get the id of the used vent.
+        ///     Gets the entered vent.
         /// </summary>
-        public Vent Vent { get; }
+        public IVent Vent { get; }
     }
 }
index 516f80b7d4c0657c0c2c924f9e2605f68f9f64da..84dc1afcc79d4801261240b669108e9629a86ebd 100644 (file)
@@ -2,11 +2,14 @@ using Impostor.Api.Innersloth;
 
 namespace Impostor.Api.Events.Player
 {
+    /// <summary>
+    ///     Called whenever a player exits a vent.
+    /// </summary>
     public interface IPlayerExitVentEvent : IPlayerEvent
     {
         /// <summary>
-        ///     Gets get the id of the used vent.
+        ///     Gets the exited vent.
         /// </summary>
-        public Vent Vent { get; }
+        public IVent Vent { get; }
     }
 }
index 0ab202d4171dd69e982db94e7c50ebbd6e41a67b..959e753423d318e1fdc7d91d8b53a3ad5b7b2150 100644 (file)
@@ -2,11 +2,14 @@ using Impostor.Api.Innersloth;
 
 namespace Impostor.Api.Events.Player
 {
+    /// <summary>
+    ///     Called whenever a player moves to another vent.
+    /// </summary>
     public interface IPlayerVentEvent : IPlayerEvent
     {
         /// <summary>
-        ///     Gets get the id of the used vent.
+        ///     Gets the vent player moved to.
         /// </summary>
-        public Vent Vent { get; }
+        public IVent NewVent { get; }
     }
 }
diff --git a/src/Impostor.Api/Extensions/DictionaryExtensions.cs b/src/Impostor.Api/Extensions/DictionaryExtensions.cs
new file mode 100644 (file)
index 0000000..b8b682f
--- /dev/null
@@ -0,0 +1,16 @@
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+namespace Impostor.Api
+{
+    public static class DictionaryExtensions
+    {
+        /// <summary>Returns a read-only <see cref="T:System.Collections.ObjectModel.ReadOnlyDictionary`2" /> wrapper for the dictionary.</summary>
+        /// <returns>An object that acts as a read-only wrapper around the <see cref="T:System.Collections.Generic.IDictionary`2" />.</returns>
+        public static ReadOnlyDictionary<TKey, TValue> AsReadOnly<TKey, TValue>(this IDictionary<TKey, TValue> dictionary)
+            where TKey : notnull
+        {
+            return new ReadOnlyDictionary<TKey, TValue>(dictionary);
+        }
+    }
+}
diff --git a/src/Impostor.Api/Innersloth/IVent.cs b/src/Impostor.Api/Innersloth/IVent.cs
new file mode 100644 (file)
index 0000000..4c697f6
--- /dev/null
@@ -0,0 +1,19 @@
+using System.Numerics;
+
+namespace Impostor.Api.Innersloth
+{
+    public interface IVent
+    {
+        int Id { get; }
+
+        string Name { get; }
+
+        Vector2 Position { get; }
+
+        IVent? Left { get; }
+
+        IVent? Center { get; }
+
+        IVent? Right { get; }
+    }
+}
index 04657d00df8ad00fbfb39f1fb5a62e28b559092e..46504c9eba9c25120ab3d064cdf1a4fe88dfbd78 100644 (file)
@@ -5,45 +5,34 @@ using Impostor.Api.Innersloth.Maps.Vents;
 
 namespace Impostor.Api.Innersloth.Maps
 {
-    public class AirshipData : MapData
+    public class AirshipData : IMapData
     {
+        private readonly IReadOnlyDictionary<int, IVent> _vents;
+
         public AirshipData()
         {
-            Vents = new[]
+            var vents = new[]
             {
-                new AirshipVent(AirshipVent.Ids.Vault, new Vector2(-12.6322f, 8.4735f)),
-                new AirshipVent(AirshipVent.Ids.Cockpit, new Vector2(-22.099f, -1.512f)),
-                new AirshipVent(AirshipVent.Ids.ViewingDeck, new Vector2(-15.659f, -11.6991f)),
-                new AirshipVent(AirshipVent.Ids.EngineRoom, new Vector2(0.203f, -2.5361f)),
-                new AirshipVent(AirshipVent.Ids.Kitchen, new Vector2(-2.6019f, -9.338f)),
-                new AirshipVent(AirshipVent.Ids.MainHallBottom, new Vector2(7.021f, -3.730999f)),
-                new AirshipVent(AirshipVent.Ids.GapRight, new Vector2(9.814f, 3.206f)),
-                new AirshipVent(AirshipVent.Ids.GapLeft, new Vector2(12.663f, 5.922f)),
-                new AirshipVent(AirshipVent.Ids.MainHallTop, new Vector2(3.605f, 6.923f)),
-                new AirshipVent(AirshipVent.Ids.Showers, new Vector2(23.9869f, -1.386f)),
-                new AirshipVent(AirshipVent.Ids.Records, new Vector2(23.2799f, 8.259998f)),
-                new AirshipVent(AirshipVent.Ids.CargoBay, new Vector2(30.4409f, -3.577f)),
-            }.ToDictionary(x => x.Id, x => (Vent)x);
+                new AirshipVent(this, AirshipVent.Ids.Vault, new Vector2(-12.6322f, 8.4735f), left: AirshipVent.Ids.Cockpit),
+                new AirshipVent(this, AirshipVent.Ids.Cockpit, new Vector2(-22.099f, -1.512f), left: AirshipVent.Ids.Vault, right: AirshipVent.Ids.ViewingDeck),
+                new AirshipVent(this, AirshipVent.Ids.ViewingDeck, new Vector2(-15.659f, -11.6991f), left: AirshipVent.Ids.Cockpit),
+                new AirshipVent(this, AirshipVent.Ids.EngineRoom, new Vector2(0.203f, -2.5361f), left: AirshipVent.Ids.Kitchen, right: AirshipVent.Ids.MainHallBottom),
+                new AirshipVent(this, AirshipVent.Ids.Kitchen, new Vector2(-2.6019f, -9.338f), left: AirshipVent.Ids.EngineRoom, right: AirshipVent.Ids.MainHallBottom),
+                new AirshipVent(this, AirshipVent.Ids.MainHallBottom, new Vector2(7.021f, -3.730999f), left: AirshipVent.Ids.EngineRoom, right: AirshipVent.Ids.Kitchen),
+                new AirshipVent(this, AirshipVent.Ids.GapRight, new Vector2(9.814f, 3.206f), left: AirshipVent.Ids.MainHallTop, right: AirshipVent.Ids.GapLeft),
+                new AirshipVent(this, AirshipVent.Ids.GapLeft, new Vector2(12.663f, 5.922f), left: AirshipVent.Ids.MainHallTop, right: AirshipVent.Ids.GapRight),
+                new AirshipVent(this, AirshipVent.Ids.MainHallTop, new Vector2(3.605f, 6.923f), left: AirshipVent.Ids.GapLeft, right: AirshipVent.Ids.GapRight),
+                new AirshipVent(this, AirshipVent.Ids.Showers, new Vector2(23.9869f, -1.386f), left: AirshipVent.Ids.Records, right: AirshipVent.Ids.CargoBay),
+                new AirshipVent(this, AirshipVent.Ids.Records, new Vector2(23.2799f, 8.259998f), left: AirshipVent.Ids.Showers, right: AirshipVent.Ids.CargoBay),
+                new AirshipVent(this, AirshipVent.Ids.CargoBay, new Vector2(30.4409f, -3.577f), left: AirshipVent.Ids.Showers, right: AirshipVent.Ids.Records),
+            };
 
-            ConnectVents(AirshipVent.Ids.Vault, left: AirshipVent.Ids.Cockpit);
-            ConnectVents(AirshipVent.Ids.Cockpit, left: AirshipVent.Ids.Vault, right: AirshipVent.Ids.ViewingDeck);
-            ConnectVents(AirshipVent.Ids.ViewingDeck, left: AirshipVent.Ids.Cockpit);
-            ConnectVents(AirshipVent.Ids.EngineRoom, left: AirshipVent.Ids.Kitchen, right: AirshipVent.Ids.MainHallBottom);
-            ConnectVents(AirshipVent.Ids.Kitchen, left: AirshipVent.Ids.EngineRoom, right: AirshipVent.Ids.MainHallBottom);
-            ConnectVents(AirshipVent.Ids.MainHallBottom, left: AirshipVent.Ids.EngineRoom, right: AirshipVent.Ids.Kitchen);
-            ConnectVents(AirshipVent.Ids.GapRight, left: AirshipVent.Ids.MainHallTop, right: AirshipVent.Ids.GapLeft);
-            ConnectVents(AirshipVent.Ids.GapLeft, left: AirshipVent.Ids.MainHallTop, right: AirshipVent.Ids.GapRight);
-            ConnectVents(AirshipVent.Ids.MainHallTop, left: AirshipVent.Ids.GapLeft, right: AirshipVent.Ids.GapRight);
-            ConnectVents(AirshipVent.Ids.Showers, left: AirshipVent.Ids.Records, right: AirshipVent.Ids.CargoBay);
-            ConnectVents(AirshipVent.Ids.Records, left: AirshipVent.Ids.Showers, right: AirshipVent.Ids.CargoBay);
-            ConnectVents(AirshipVent.Ids.CargoBay, left: AirshipVent.Ids.Showers, right: AirshipVent.Ids.Records);
+            Vents = vents.ToDictionary(x => x.Id, x => x).AsReadOnly();
+            _vents = vents.ToDictionary(x => (int)x.Id, x => (IVent)x).AsReadOnly();
         }
 
-        public override IReadOnlyDictionary<int, Vent> Vents { get; }
+        public IReadOnlyDictionary<AirshipVent.Ids, AirshipVent> Vents { get; }
 
-        private void ConnectVents(AirshipVent.Ids vent, AirshipVent.Ids? left = null, AirshipVent.Ids? center = null, AirshipVent.Ids? right = null)
-        {
-            ConnectVents((int)vent, (int?)left, (int?)center, (int?)right);
-        }
+        IReadOnlyDictionary<int, IVent> IMapData.Vents => _vents;
     }
 }
diff --git a/src/Impostor.Api/Innersloth/Maps/IMapData.cs b/src/Impostor.Api/Innersloth/Maps/IMapData.cs
new file mode 100644 (file)
index 0000000..8f94b38
--- /dev/null
@@ -0,0 +1,17 @@
+using System.Collections.Generic;
+
+namespace Impostor.Api.Innersloth.Maps
+{
+    public interface IMapData
+    {
+        public static IReadOnlyDictionary<MapTypes, IMapData> Maps { get; } = new Dictionary<MapTypes, IMapData>
+        {
+            [MapTypes.Skeld] = new SkeldData(),
+            [MapTypes.MiraHQ] = new MiraData(),
+            [MapTypes.Polus] = new PolusData(),
+            [MapTypes.Airship] = new AirshipData(),
+        }.AsReadOnly();
+
+        IReadOnlyDictionary<int, IVent> Vents { get; }
+    }
+}
diff --git a/src/Impostor.Api/Innersloth/Maps/MapData.cs b/src/Impostor.Api/Innersloth/Maps/MapData.cs
deleted file mode 100644 (file)
index 53428f5..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-using System.Collections.Generic;
-
-namespace Impostor.Api.Innersloth.Maps
-{
-    public abstract class MapData
-    {
-        public static IReadOnlyDictionary<MapTypes, MapData> Maps { get; } = new Dictionary<MapTypes, MapData>
-        {
-            [MapTypes.Skeld] = new SkeldData(),
-            [MapTypes.MiraHQ] = new MiraData(),
-            [MapTypes.Polus] = new PolusData(),
-            [MapTypes.Airship] = new AirshipData(),
-        };
-
-        public abstract IReadOnlyDictionary<int, Vent> Vents { get; }
-
-        protected void ConnectVents(int vent, int? left = null, int? center = null, int? right = null)
-        {
-            Vents[vent].Left = left != null ? Vents[left.Value] : null;
-            Vents[vent].Center = center != null ? Vents[center.Value] : null;
-            Vents[vent].Right = right != null ? Vents[right.Value] : null;
-        }
-    }
-}
index 41f2c61fed34fad2fd909776e405b285a1505c02..37ed2451fdeef6a1849e5a1fb6f4cedf176baac5 100644 (file)
@@ -5,43 +5,33 @@ using Impostor.Api.Innersloth.Maps.Vents;
 
 namespace Impostor.Api.Innersloth.Maps
 {
-    public class MiraData : MapData
+    public class MiraData : IMapData
     {
+        private readonly IReadOnlyDictionary<int, IVent> _vents;
+
         public MiraData()
         {
-            Vents = new[]
+            var vents = new[]
             {
-                new MiraVent(MiraVent.Ids.Balcony, new Vector2(23.77f, -1.94f)),
-                new MiraVent(MiraVent.Ids.Cafeteria, new Vector2(23.9f, 7.18f)),
-                new MiraVent(MiraVent.Ids.Reactor, new Vector2(0.4800001f, 10.697f)),
-                new MiraVent(MiraVent.Ids.Laboratory, new Vector2(11.606f, 13.816f)),
-                new MiraVent(MiraVent.Ids.Office, new Vector2(13.28f, 20.13f)),
-                new MiraVent(MiraVent.Ids.Admin, new Vector2(22.39f, 17.23f)),
-                new MiraVent(MiraVent.Ids.Greenhouse, new Vector2(17.85f, 25.23f)),
-                new MiraVent(MiraVent.Ids.Medbay, new Vector2(15.41f, -1.82f)),
-                new MiraVent(MiraVent.Ids.Decontamination, new Vector2(6.83f, 3.145f)),
-                new MiraVent(MiraVent.Ids.LockerRoom, new Vector2(4.29f, 0.5299997f)),
-                new MiraVent(MiraVent.Ids.Launchpad, new Vector2(-6.18f, 3.56f)),
-            }.ToDictionary(x => x.Id, x => (Vent)x);
+                new MiraVent(this, MiraVent.Ids.Balcony, new Vector2(23.77f, -1.94f), left: MiraVent.Ids.Medbay, right: MiraVent.Ids.Cafeteria),
+                new MiraVent(this, MiraVent.Ids.Cafeteria, new Vector2(23.9f, 7.18f), left: MiraVent.Ids.Admin, right: MiraVent.Ids.Balcony),
+                new MiraVent(this, MiraVent.Ids.Reactor, new Vector2(0.4800001f, 10.697f), left: MiraVent.Ids.Laboratory, center: MiraVent.Ids.Decontamination, right: MiraVent.Ids.Launchpad),
+                new MiraVent(this, MiraVent.Ids.Laboratory, new Vector2(11.606f, 13.816f), left: MiraVent.Ids.Reactor, center: MiraVent.Ids.Decontamination, right: MiraVent.Ids.Office),
+                new MiraVent(this, MiraVent.Ids.Office, new Vector2(13.28f, 20.13f), left: MiraVent.Ids.Laboratory, center: MiraVent.Ids.Admin, right: MiraVent.Ids.Greenhouse),
+                new MiraVent(this, MiraVent.Ids.Admin, new Vector2(22.39f, 17.23f), left: MiraVent.Ids.Greenhouse, center: MiraVent.Ids.Cafeteria, right: MiraVent.Ids.Office),
+                new MiraVent(this, MiraVent.Ids.Greenhouse, new Vector2(17.85f, 25.23f), left: MiraVent.Ids.Admin, right: MiraVent.Ids.Office),
+                new MiraVent(this, MiraVent.Ids.Medbay, new Vector2(15.41f, -1.82f), left: MiraVent.Ids.Balcony, right: MiraVent.Ids.LockerRoom),
+                new MiraVent(this, MiraVent.Ids.Decontamination, new Vector2(6.83f, 3.145f), left: MiraVent.Ids.Reactor, center: MiraVent.Ids.LockerRoom, right: MiraVent.Ids.Laboratory),
+                new MiraVent(this, MiraVent.Ids.LockerRoom, new Vector2(4.29f, 0.5299997f), left: MiraVent.Ids.Medbay, center: MiraVent.Ids.Launchpad, right: MiraVent.Ids.Decontamination),
+                new MiraVent(this, MiraVent.Ids.Launchpad, new Vector2(-6.18f, 3.56f), left: MiraVent.Ids.Reactor, right: MiraVent.Ids.LockerRoom),
+            };
 
-            ConnectVents(MiraVent.Ids.Balcony, left: MiraVent.Ids.Medbay, right: MiraVent.Ids.Cafeteria);
-            ConnectVents(MiraVent.Ids.Cafeteria, left: MiraVent.Ids.Admin, right: MiraVent.Ids.Balcony);
-            ConnectVents(MiraVent.Ids.Reactor, left: MiraVent.Ids.Laboratory, center: MiraVent.Ids.Decontamination, right: MiraVent.Ids.Launchpad);
-            ConnectVents(MiraVent.Ids.Laboratory, left: MiraVent.Ids.Reactor, center: MiraVent.Ids.Decontamination, right: MiraVent.Ids.Office);
-            ConnectVents(MiraVent.Ids.Office, left: MiraVent.Ids.Laboratory, center: MiraVent.Ids.Admin, right: MiraVent.Ids.Greenhouse);
-            ConnectVents(MiraVent.Ids.Admin, left: MiraVent.Ids.Greenhouse, center: MiraVent.Ids.Cafeteria, right: MiraVent.Ids.Office);
-            ConnectVents(MiraVent.Ids.Greenhouse, left: MiraVent.Ids.Admin, right: MiraVent.Ids.Office);
-            ConnectVents(MiraVent.Ids.Medbay, left: MiraVent.Ids.Balcony, right: MiraVent.Ids.LockerRoom);
-            ConnectVents(MiraVent.Ids.Decontamination, left: MiraVent.Ids.Reactor, center: MiraVent.Ids.LockerRoom, right: MiraVent.Ids.Laboratory);
-            ConnectVents(MiraVent.Ids.LockerRoom, left: MiraVent.Ids.Medbay, center: MiraVent.Ids.Launchpad, right: MiraVent.Ids.Decontamination);
-            ConnectVents(MiraVent.Ids.Launchpad, left: MiraVent.Ids.Reactor, right: MiraVent.Ids.LockerRoom);
+            Vents = vents.ToDictionary(x => x.Id, x => x).AsReadOnly();
+            _vents = vents.ToDictionary(x => (int)x.Id, x => (IVent)x).AsReadOnly();
         }
 
-        public override IReadOnlyDictionary<int, Vent> Vents { get; }
+        public IReadOnlyDictionary<MiraVent.Ids, MiraVent> Vents { get; }
 
-        private void ConnectVents(MiraVent.Ids vent, MiraVent.Ids? left = null, MiraVent.Ids? center = null, MiraVent.Ids? right = null)
-        {
-            ConnectVents((int)vent, (int?)left, (int?)center, (int?)right);
-        }
+        IReadOnlyDictionary<int, IVent> IMapData.Vents => _vents;
     }
 }
index 5748d26f108df80fe98d1812e960fe24e1dcdbc5..76bc97043f849e74f31acf1e2b9efb765a95878c 100644 (file)
@@ -5,45 +5,34 @@ using Impostor.Api.Innersloth.Maps.Vents;
 
 namespace Impostor.Api.Innersloth.Maps
 {
-    public class PolusData : MapData
+    public class PolusData : IMapData
     {
+        private readonly IReadOnlyDictionary<int, IVent> _vents;
+
         public PolusData()
         {
-            Vents = new[]
+            var vents = new[]
             {
-                new PolusVent(PolusVent.Ids.Security, new Vector2(1.929f, -9.558001f)),
-                new PolusVent(PolusVent.Ids.Electrical, new Vector2(6.9f, -14.41f)),
-                new PolusVent(PolusVent.Ids.O2, new Vector2(3.51f, -16.58f)),
-                new PolusVent(PolusVent.Ids.Communications, new Vector2(12.304f, -18.898f)),
-                new PolusVent(PolusVent.Ids.Office, new Vector2(16.379f, -19.599f)),
-                new PolusVent(PolusVent.Ids.Admin, new Vector2(20.089f, -25.517f)),
-                new PolusVent(PolusVent.Ids.Laboratory, new Vector2(32.963f, -9.526f)),
-                new PolusVent(PolusVent.Ids.Lava, new Vector2(30.907f, -11.86f)),
-                new PolusVent(PolusVent.Ids.Storage, new Vector2(22f, -12.19f)),
-                new PolusVent(PolusVent.Ids.RightStabilizer, new Vector2(24.02f, -8.39f)),
-                new PolusVent(PolusVent.Ids.LeftStabilizer, new Vector2(9.64f, -7.72f)),
-                new PolusVent(PolusVent.Ids.OutsideAdmin, new Vector2(18.93f, -24.85f)),
-            }.ToDictionary(x => x.Id, x => (Vent)x);
+                new PolusVent(this, PolusVent.Ids.Security, new Vector2(1.929f, -9.558001f), left: PolusVent.Ids.O2, right: PolusVent.Ids.Electrical),
+                new PolusVent(this, PolusVent.Ids.Electrical, new Vector2(6.9f, -14.41f), left: PolusVent.Ids.O2, right: PolusVent.Ids.Security),
+                new PolusVent(this, PolusVent.Ids.O2, new Vector2(3.51f, -16.58f), left: PolusVent.Ids.Electrical, right: PolusVent.Ids.Security),
+                new PolusVent(this, PolusVent.Ids.Communications, new Vector2(12.304f, -18.898f), left: PolusVent.Ids.Storage, right: PolusVent.Ids.Office),
+                new PolusVent(this, PolusVent.Ids.Office, new Vector2(16.379f, -19.599f), left: PolusVent.Ids.Communications, right: PolusVent.Ids.Storage),
+                new PolusVent(this, PolusVent.Ids.Admin, new Vector2(20.089f, -25.517f), left: PolusVent.Ids.OutsideAdmin, right: PolusVent.Ids.Lava),
+                new PolusVent(this, PolusVent.Ids.Laboratory, new Vector2(32.963f, -9.526f), right: PolusVent.Ids.Lava),
+                new PolusVent(this, PolusVent.Ids.Lava, new Vector2(30.907f, -11.86f), left: PolusVent.Ids.Laboratory, right: PolusVent.Ids.Admin),
+                new PolusVent(this, PolusVent.Ids.Storage, new Vector2(22f, -12.19f), left: PolusVent.Ids.Communications, right: PolusVent.Ids.Office),
+                new PolusVent(this, PolusVent.Ids.RightStabilizer, new Vector2(24.02f, -8.39f), left: PolusVent.Ids.LeftStabilizer),
+                new PolusVent(this, PolusVent.Ids.LeftStabilizer, new Vector2(9.64f, -7.72f), left: PolusVent.Ids.RightStabilizer),
+                new PolusVent(this, PolusVent.Ids.OutsideAdmin, new Vector2(18.93f, -24.85f), right: PolusVent.Ids.Admin),
+            };
 
-            ConnectVents(PolusVent.Ids.Security, left: PolusVent.Ids.O2, right: PolusVent.Ids.Electrical);
-            ConnectVents(PolusVent.Ids.Electrical, left: PolusVent.Ids.O2, right: PolusVent.Ids.Security);
-            ConnectVents(PolusVent.Ids.O2, left: PolusVent.Ids.Electrical, right: PolusVent.Ids.Security);
-            ConnectVents(PolusVent.Ids.Communications, left: PolusVent.Ids.Storage, right: PolusVent.Ids.Office);
-            ConnectVents(PolusVent.Ids.Office, left: PolusVent.Ids.Communications, right: PolusVent.Ids.Storage);
-            ConnectVents(PolusVent.Ids.Admin, left: PolusVent.Ids.OutsideAdmin, right: PolusVent.Ids.Lava);
-            ConnectVents(PolusVent.Ids.Laboratory, right: PolusVent.Ids.Lava);
-            ConnectVents(PolusVent.Ids.Lava, left: PolusVent.Ids.Laboratory, right: PolusVent.Ids.Admin);
-            ConnectVents(PolusVent.Ids.Storage, left: PolusVent.Ids.Communications, right: PolusVent.Ids.Office);
-            ConnectVents(PolusVent.Ids.RightStabilizer, left: PolusVent.Ids.LeftStabilizer);
-            ConnectVents(PolusVent.Ids.LeftStabilizer, left: PolusVent.Ids.RightStabilizer);
-            ConnectVents(PolusVent.Ids.OutsideAdmin, right: PolusVent.Ids.Admin);
+            Vents = vents.ToDictionary(x => x.Id, x => x).AsReadOnly();
+            _vents = vents.ToDictionary(x => (int)x.Id, x => (IVent)x).AsReadOnly();
         }
 
-        public override IReadOnlyDictionary<int, Vent> Vents { get; }
+        public IReadOnlyDictionary<PolusVent.Ids, PolusVent> Vents { get; }
 
-        private void ConnectVents(PolusVent.Ids vent, PolusVent.Ids? left = null, PolusVent.Ids? center = null, PolusVent.Ids? right = null)
-        {
-            ConnectVents((int)vent, (int?)left, (int?)center, (int?)right);
-        }
+        IReadOnlyDictionary<int, IVent> IMapData.Vents => _vents;
     }
 }
index b0bb95d9585b5f245d235fe451bfcfa404d7b3ac..6555ba1b91ad18a6d56a47c579b617e25a00fc17 100644 (file)
@@ -5,49 +5,36 @@ using Impostor.Api.Innersloth.Maps.Vents;
 
 namespace Impostor.Api.Innersloth.Maps
 {
-    public class SkeldData : MapData
+    public class SkeldData : IMapData
     {
+        private readonly IReadOnlyDictionary<int, IVent> _vents;
+
         public SkeldData()
         {
-            Vents = new[]
+            var vents = new[]
             {
-                new SkeldVent(SkeldVent.Ids.Admin, new Vector2(2.544f, -9.955201f)),
-                new SkeldVent(SkeldVent.Ids.RightHallway, new Vector2(9.384f, -6.438f)),
-                new SkeldVent(SkeldVent.Ids.Cafeteria, new Vector2(4.2588f, -0.276f)),
-                new SkeldVent(SkeldVent.Ids.Electrical, new Vector2(-9.7764f, -8.034f)),
-                new SkeldVent(SkeldVent.Ids.UpperEngine, new Vector2(-15.288f, 2.52f)),
-                new SkeldVent(SkeldVent.Ids.Security, new Vector2(-12.534f, -6.9492f)),
-                new SkeldVent(SkeldVent.Ids.Medbay, new Vector2(-10.608f, -4.176f)),
-                new SkeldVent(SkeldVent.Ids.Weapons, new Vector2(8.820001f, 3.324f)),
-                new SkeldVent(SkeldVent.Ids.LowerReactor, new Vector2(-20.796f, -6.9528f)),
-                new SkeldVent(SkeldVent.Ids.LowerEngine, new Vector2(-15.2508f, -13.656f)),
-                new SkeldVent(SkeldVent.Ids.Shields, new Vector2(9.5232f, -14.3376f)),
-                new SkeldVent(SkeldVent.Ids.UpperReactor, new Vector2(-21.876f, -3.0516f)),
-                new SkeldVent(SkeldVent.Ids.UpperNavigation, new Vector2(16.008f, -3.168f)),
-                new SkeldVent(SkeldVent.Ids.LowerNavigation, new Vector2(16.008f, -6.384f)),
-            }.ToDictionary(x => x.Id, x => (Vent)x);
+                new SkeldVent(this, SkeldVent.Ids.Admin, new Vector2(2.544f, -9.955201f), left: SkeldVent.Ids.Cafeteria, right: SkeldVent.Ids.RightHallway),
+                new SkeldVent(this, SkeldVent.Ids.RightHallway, new Vector2(9.384f, -6.438f), left: SkeldVent.Ids.Admin, right: SkeldVent.Ids.Cafeteria),
+                new SkeldVent(this, SkeldVent.Ids.Cafeteria, new Vector2(4.2588f, -0.276f), left: SkeldVent.Ids.Admin, right: SkeldVent.Ids.RightHallway),
+                new SkeldVent(this, SkeldVent.Ids.Electrical, new Vector2(-9.7764f, -8.034f), left: SkeldVent.Ids.Security, right: SkeldVent.Ids.Medbay),
+                new SkeldVent(this, SkeldVent.Ids.UpperEngine, new Vector2(-15.288f, 2.52f), left: SkeldVent.Ids.UpperReactor),
+                new SkeldVent(this, SkeldVent.Ids.Security, new Vector2(-12.534f, -6.9492f), left: SkeldVent.Ids.Medbay, right: SkeldVent.Ids.Electrical),
+                new SkeldVent(this, SkeldVent.Ids.Medbay, new Vector2(-10.608f, -4.176f), left: SkeldVent.Ids.Security, right: SkeldVent.Ids.Electrical),
+                new SkeldVent(this, SkeldVent.Ids.Weapons, new Vector2(8.820001f, 3.324f), right: SkeldVent.Ids.UpperNavigation),
+                new SkeldVent(this, SkeldVent.Ids.LowerReactor, new Vector2(-20.796f, -6.9528f), left: SkeldVent.Ids.LowerEngine),
+                new SkeldVent(this, SkeldVent.Ids.LowerEngine, new Vector2(-15.2508f, -13.656f), left: SkeldVent.Ids.LowerReactor),
+                new SkeldVent(this, SkeldVent.Ids.Shields, new Vector2(9.5232f, -14.3376f), left: SkeldVent.Ids.LowerNavigation),
+                new SkeldVent(this, SkeldVent.Ids.UpperReactor, new Vector2(-21.876f, -3.0516f), left: SkeldVent.Ids.UpperEngine),
+                new SkeldVent(this, SkeldVent.Ids.UpperNavigation, new Vector2(16.008f, -3.168f), right: SkeldVent.Ids.Weapons),
+                new SkeldVent(this, SkeldVent.Ids.LowerNavigation, new Vector2(16.008f, -6.384f), right: SkeldVent.Ids.Shields),
+            };
 
-            ConnectVents(SkeldVent.Ids.Admin, left: SkeldVent.Ids.Cafeteria, right: SkeldVent.Ids.RightHallway);
-            ConnectVents(SkeldVent.Ids.RightHallway, left: SkeldVent.Ids.Admin, right: SkeldVent.Ids.Cafeteria);
-            ConnectVents(SkeldVent.Ids.Cafeteria, left: SkeldVent.Ids.Admin, right: SkeldVent.Ids.RightHallway);
-            ConnectVents(SkeldVent.Ids.Electrical, left: SkeldVent.Ids.Security, right: SkeldVent.Ids.Medbay);
-            ConnectVents(SkeldVent.Ids.UpperEngine, left: SkeldVent.Ids.UpperReactor);
-            ConnectVents(SkeldVent.Ids.Security, left: SkeldVent.Ids.Medbay, right: SkeldVent.Ids.Electrical);
-            ConnectVents(SkeldVent.Ids.Medbay, left: SkeldVent.Ids.Security, right: SkeldVent.Ids.Electrical);
-            ConnectVents(SkeldVent.Ids.Weapons, right: SkeldVent.Ids.UpperNavigation);
-            ConnectVents(SkeldVent.Ids.LowerReactor, left: SkeldVent.Ids.LowerEngine);
-            ConnectVents(SkeldVent.Ids.LowerEngine, left: SkeldVent.Ids.LowerReactor);
-            ConnectVents(SkeldVent.Ids.Shields, left: SkeldVent.Ids.LowerNavigation);
-            ConnectVents(SkeldVent.Ids.UpperReactor, left: SkeldVent.Ids.UpperEngine);
-            ConnectVents(SkeldVent.Ids.UpperNavigation, right: SkeldVent.Ids.Weapons);
-            ConnectVents(SkeldVent.Ids.LowerNavigation, right: SkeldVent.Ids.Shields);
+            Vents = vents.ToDictionary(x => x.Id, x => x).AsReadOnly();
+            _vents = vents.ToDictionary(x => (int)x.Id, x => (IVent)x).AsReadOnly();
         }
 
-        public override IReadOnlyDictionary<int, Vent> Vents { get; }
+        public IReadOnlyDictionary<SkeldVent.Ids, SkeldVent> Vents { get; }
 
-        private void ConnectVents(SkeldVent.Ids vent, SkeldVent.Ids? left = null, SkeldVent.Ids? center = null, SkeldVent.Ids? right = null)
-        {
-            ConnectVents((int)vent, (int?)left, (int?)center, (int?)right);
-        }
+        IReadOnlyDictionary<int, IVent> IMapData.Vents => _vents;
     }
 }
index 7605504c8e5e971967e0307a0b9fd772c0eea9df..33146924418ca5336f5586fb16cbe465edc20b6a 100644 (file)
@@ -1,11 +1,25 @@
+using System;
 using System.Numerics;
 
 namespace Impostor.Api.Innersloth.Maps.Vents
 {
-    public class AirshipVent : Vent
+    public class AirshipVent : IVent
     {
-        internal AirshipVent(Ids id, Vector2 position) : base((int)id, id.ToString(), position)
+        private readonly Lazy<AirshipVent>? _left;
+
+        private readonly Lazy<AirshipVent>? _center;
+
+        private readonly Lazy<AirshipVent>? _right;
+
+        internal AirshipVent(AirshipData data, Ids id, Vector2 position, Ids? left = null, Ids? center = null, Ids? right = null)
         {
+            Id = id;
+            Name = id.ToString();
+            Position = position;
+
+            _left = left == null ? null : new Lazy<AirshipVent>(() => data.Vents[left.Value]);
+            _center = center == null ? null : new Lazy<AirshipVent>(() => data.Vents[center.Value]);
+            _right = right == null ? null : new Lazy<AirshipVent>(() => data.Vents[right.Value]);
         }
 
         public enum Ids
@@ -23,5 +37,25 @@ namespace Impostor.Api.Innersloth.Maps.Vents
             Records = 10,
             CargoBay = 11,
         }
+
+        public Ids Id { get; }
+
+        int IVent.Id => (int)Id;
+
+        public string Name { get; }
+
+        public Vector2 Position { get; }
+
+        public AirshipVent? Left => _left?.Value;
+
+        IVent? IVent.Left => Left;
+
+        public AirshipVent? Center => _center?.Value;
+
+        IVent? IVent.Center => Center;
+
+        public AirshipVent? Right => _right?.Value;
+
+        IVent? IVent.Right => Right;
     }
 }
index 775401a35ae637d17d738515d0208f3cb799133e..81daddb18e5e7d6dd014388b67a3bf60c1d7feeb 100644 (file)
@@ -1,11 +1,25 @@
+using System;
 using System.Numerics;
 
 namespace Impostor.Api.Innersloth.Maps.Vents
 {
-    public class MiraVent : Vent
+    public class MiraVent : IVent
     {
-        internal MiraVent(Ids id, Vector2 position) : base((int)id, id.ToString(), position)
+        private readonly Lazy<MiraVent>? _left;
+
+        private readonly Lazy<MiraVent>? _center;
+
+        private readonly Lazy<MiraVent>? _right;
+
+        internal MiraVent(MiraData data, Ids id, Vector2 position, Ids? left = null, Ids? center = null, Ids? right = null)
         {
+            Id = id;
+            Name = id.ToString();
+            Position = position;
+
+            _left = left == null ? null : new Lazy<MiraVent>(() => data.Vents[left.Value]);
+            _center = center == null ? null : new Lazy<MiraVent>(() => data.Vents[center.Value]);
+            _right = right == null ? null : new Lazy<MiraVent>(() => data.Vents[right.Value]);
         }
 
         public enum Ids
@@ -22,5 +36,25 @@ namespace Impostor.Api.Innersloth.Maps.Vents
             LockerRoom = 10,
             Launchpad = 11,
         }
+
+        public Ids Id { get; }
+
+        int IVent.Id => (int)Id;
+
+        public string Name { get; }
+
+        public Vector2 Position { get; }
+
+        public MiraVent? Left => _left?.Value;
+
+        IVent? IVent.Left => Left;
+
+        public MiraVent? Center => _center?.Value;
+
+        IVent? IVent.Center => Center;
+
+        public MiraVent? Right => _right?.Value;
+
+        IVent? IVent.Right => Right;
     }
 }
index 8310af07b47957b886a1b2efe37f51b79ad04ce5..54b542afffbcc2a069a5d37c4b90dca8fe8ff121 100644 (file)
@@ -1,11 +1,25 @@
+using System;
 using System.Numerics;
 
 namespace Impostor.Api.Innersloth.Maps.Vents
 {
-    public class PolusVent : Vent
+    public class PolusVent : IVent
     {
-        internal PolusVent(Ids id, Vector2 position) : base((int)id, id.ToString(), position)
+        private readonly Lazy<PolusVent>? _left;
+
+        private readonly Lazy<PolusVent>? _center;
+
+        private readonly Lazy<PolusVent>? _right;
+
+        internal PolusVent(PolusData data, Ids id, Vector2 position, Ids? left = null, Ids? center = null, Ids? right = null)
         {
+            Id = id;
+            Name = id.ToString();
+            Position = position;
+
+            _left = left == null ? null : new Lazy<PolusVent>(() => data.Vents[left.Value]);
+            _center = center == null ? null : new Lazy<PolusVent>(() => data.Vents[center.Value]);
+            _right = right == null ? null : new Lazy<PolusVent>(() => data.Vents[right.Value]);
         }
 
         public enum Ids
@@ -23,5 +37,25 @@ namespace Impostor.Api.Innersloth.Maps.Vents
             LeftStabilizer = 10,
             OutsideAdmin = 11,
         }
+
+        public Ids Id { get; }
+
+        int IVent.Id => (int)Id;
+
+        public string Name { get; }
+
+        public Vector2 Position { get; }
+
+        public PolusVent? Left => _left?.Value;
+
+        IVent? IVent.Left => Left;
+
+        public PolusVent? Center => _center?.Value;
+
+        IVent? IVent.Center => Center;
+
+        public PolusVent? Right => _right?.Value;
+
+        IVent? IVent.Right => Right;
     }
 }
index e670a8d3d5708c83d21e3b1916082ba22fc5ead0..747b6fdf96484e9108e631409c37907d151f72f4 100644 (file)
@@ -1,11 +1,25 @@
+using System;
 using System.Numerics;
 
 namespace Impostor.Api.Innersloth.Maps.Vents
 {
-    public class SkeldVent : Vent
+    public class SkeldVent : IVent
     {
-        internal SkeldVent(Ids id, Vector2 position) : base((int)id, id.ToString(), position)
+        private readonly Lazy<SkeldVent>? _left;
+
+        private readonly Lazy<SkeldVent>? _center;
+
+        private readonly Lazy<SkeldVent>? _right;
+
+        internal SkeldVent(SkeldData data, Ids id, Vector2 position, Ids? left = null, Ids? center = null, Ids? right = null)
         {
+            Id = id;
+            Name = id.ToString();
+            Position = position;
+
+            _left = left == null ? null : new Lazy<SkeldVent>(() => data.Vents[left.Value]);
+            _center = center == null ? null : new Lazy<SkeldVent>(() => data.Vents[center.Value]);
+            _right = right == null ? null : new Lazy<SkeldVent>(() => data.Vents[right.Value]);
         }
 
         public enum Ids
@@ -25,5 +39,25 @@ namespace Impostor.Api.Innersloth.Maps.Vents
             UpperNavigation = 12,
             LowerNavigation = 13,
         }
+
+        public Ids Id { get; }
+
+        int IVent.Id => (int)Id;
+
+        public string Name { get; }
+
+        public Vector2 Position { get; }
+
+        public SkeldVent? Left => _left?.Value;
+
+        IVent? IVent.Left => Left;
+
+        public SkeldVent? Center => _center?.Value;
+
+        IVent? IVent.Center => Center;
+
+        public SkeldVent? Right => _right?.Value;
+
+        IVent? IVent.Right => Right;
     }
 }
diff --git a/src/Impostor.Api/Innersloth/Vent.cs b/src/Impostor.Api/Innersloth/Vent.cs
deleted file mode 100644 (file)
index 723207b..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-using System.Numerics;
-
-namespace Impostor.Api.Innersloth
-{
-    public abstract class Vent
-    {
-        internal Vent(int id, string name, Vector2 position)
-        {
-            Id = id;
-            Name = name;
-            Position = position;
-        }
-
-        public int Id { get; }
-
-        public string Name { get; }
-
-        public Vector2 Position { get; }
-
-        public Vent? Left { get; internal set; }
-
-        public Vent? Center { get; internal set; }
-
-        public Vent? Right { get; internal set; }
-    }
-}
index fbef0f40ba884612f169a5c942ac1a2e9c33107f..999cfc174cef2f035d2a8dcbe723466f543b9837 100644 (file)
@@ -103,13 +103,13 @@ namespace Impostor.Plugins.Example.Handlers
         [EventListener]
         public void OnPlayerExitVentEvent(IPlayerExitVentEvent e)
         {
-            _logger.LogInformation("Player {player} exit the vent in {vent}", e.PlayerControl.PlayerInfo.PlayerName, e.Vent.Name);
+            _logger.LogInformation("Player {player} exited the vent in {vent}", e.PlayerControl.PlayerInfo.PlayerName, e.Vent.Name);
         }
 
         [EventListener]
         public void OnPlayerVentEvent(IPlayerVentEvent e)
         {
-            _logger.LogInformation("Player {player} vented to {vent}", e.PlayerControl.PlayerInfo.PlayerName, e.Vent.Name);
+            _logger.LogInformation("Player {player} vented to {vent}", e.PlayerControl.PlayerInfo.PlayerName, e.NewVent.Name);
         }
     }
 }
index 8e22eb6df96d3c411c42dc58d8ab7baaa375d136..b072dc799337acc375fee49f71a094b43cfe365b 100644 (file)
@@ -8,7 +8,7 @@ namespace Impostor.Server.Events.Player
 {
     public class PlayerEnterVentEvent : IPlayerEnterVentEvent
     {
-        public PlayerEnterVentEvent(IGame game, IClientPlayer sender, IInnerPlayerControl innerPlayerPhysics, Vent vent)
+        public PlayerEnterVentEvent(IGame game, IClientPlayer sender, IInnerPlayerControl innerPlayerPhysics, IVent vent)
         {
             Game = game;
             ClientPlayer = sender;
@@ -22,6 +22,6 @@ namespace Impostor.Server.Events.Player
 
         public IInnerPlayerControl PlayerControl { get; }
 
-        public Vent Vent { get; }
+        public IVent Vent { get; }
     }
 }
index 93842b225157fe73a7f7e11a94cff7414f31fd5a..2343c708dd76e33ac5038720e1f83b69085342df 100644 (file)
@@ -8,7 +8,7 @@ namespace Impostor.Server.Events.Player
 {
     public class PlayerExitVentEvent : IPlayerExitVentEvent
     {
-        public PlayerExitVentEvent(IGame game, IClientPlayer sender, IInnerPlayerControl innerPlayerPhysics, Vent vent)
+        public PlayerExitVentEvent(IGame game, IClientPlayer sender, IInnerPlayerControl innerPlayerPhysics, IVent vent)
         {
             Game = game;
             ClientPlayer = sender;
@@ -22,6 +22,6 @@ namespace Impostor.Server.Events.Player
 
         public IInnerPlayerControl PlayerControl { get; }
 
-        public Vent Vent { get; }
+        public IVent Vent { get; }
     }
 }
index 82a99cdf66b5edabd9e48ff6b4f6e6c4d13594a7..7cfdcd0277ea39dda0d28c2889c41978234a288c 100644 (file)
@@ -8,12 +8,12 @@ namespace Impostor.Server.Events.Player
 {
     public class PlayerVentEvent : IPlayerVentEvent
     {
-        public PlayerVentEvent(IGame game, IClientPlayer sender, IInnerPlayerControl innerPlayerPhysics, Vent vent)
+        public PlayerVentEvent(IGame game, IClientPlayer sender, IInnerPlayerControl innerPlayerPhysics, IVent vent)
         {
             Game = game;
             ClientPlayer = sender;
             PlayerControl = innerPlayerPhysics;
-            Vent = vent;
+            NewVent = vent;
         }
 
         public IGame Game { get; }
@@ -22,6 +22,6 @@ namespace Impostor.Server.Events.Player
 
         public IInnerPlayerControl PlayerControl { get; }
 
-        public Vent Vent { get; }
+        public IVent NewVent { get; }
     }
 }
index 84861b1a4d99e4be15fe28c61aa3ea119a257422..3ed285c106723d76ae4b59f1ae8dbdd82c643b61 100644 (file)
@@ -16,7 +16,7 @@ namespace Impostor.Server.Net.Inner.Objects.ShipStatus
         {
         }
 
-        public override MapData Data => MapData.Maps[MapTypes.Airship];
+        public override IMapData Data => IMapData.Maps[MapTypes.Airship];
 
         public override Dictionary<int, bool> Doors { get; } = new Dictionary<int, bool>(21);
 
index 143c98f779c539dcac13f28e27d6563dec1f534e..6f1879de0d3fb3845a0d8929b8bc1d1581db9c7e 100644 (file)
@@ -15,7 +15,7 @@ namespace Impostor.Server.Net.Inner.Objects.ShipStatus
         {
         }
 
-        public override MapData Data => MapData.Maps[MapTypes.MiraHQ];
+        public override IMapData Data => IMapData.Maps[MapTypes.MiraHQ];
 
         public override Dictionary<int, bool> Doors { get; } = new Dictionary<int, bool>(0);
 
index 7301bc44c114caa7ded3b963c8a4f6ebdcb53335..3274727ed41c52f74677d7b51e7eaa2bb195fcac 100644 (file)
@@ -15,7 +15,7 @@ namespace Impostor.Server.Net.Inner.Objects.ShipStatus
         {
         }
 
-        public override MapData Data => MapData.Maps[MapTypes.Polus];
+        public override IMapData Data => IMapData.Maps[MapTypes.Polus];
 
         public override Dictionary<int, bool> Doors { get; } = new Dictionary<int, bool>(12);
 
index 0f7a4edd832bb818551fd027dc5dfdf1b58fe22a..3dd2d5413949a066bc0e1f89f42bfd309ded7a24 100644 (file)
@@ -26,7 +26,7 @@ namespace Impostor.Server.Net.Inner.Objects.ShipStatus
             Components.Add(this);
         }
 
-        public abstract MapData Data { get; }
+        public abstract IMapData Data { get; }
 
         public abstract Dictionary<int, bool> Doors { get; }
 
index 6d04f5bb2b9ae70e38e077325f24182887a1a9a5..6670aad68dcf82d73db7fc053b2f0c8840fd4d4a 100644 (file)
@@ -15,7 +15,7 @@ namespace Impostor.Server.Net.Inner.Objects.ShipStatus
         {
         }
 
-        public override MapData Data { get; } = MapData.Maps[MapTypes.Skeld];
+        public override IMapData Data { get; } = IMapData.Maps[MapTypes.Skeld];
 
         public override Dictionary<int, bool> Doors { get; } = new Dictionary<int, bool>(13);