using System.Collections.Generic; using System.Linq; namespace QSB.WorldSync { public static class WorldRegistry { public static List WorldObjects { get; } = new List(); public static T GetObject(int id) where T : WorldObject { return WorldObjects.OfType().FirstOrDefault(x => x.ObjectId == id); } } }