using System.Collections.Generic; using System.Linq; namespace QSB.WorldSync { public static class WorldRegistry { private static readonly List _worldObjects = new List(); public static void AddObject(WorldObject worldObject) { _worldObjects.Add(worldObject); } public static List GetObjects() { return _worldObjects.OfType().ToList(); } public static T GetObject(int id) where T : WorldObject { return GetObjects().FirstOrDefault(x => x.ObjectId == id); } } }