using System.Collections.Generic; using System.Linq; namespace QSB.WorldSync { public static class WorldRegistry { private static readonly List _worldObjects = new List(); public static List OrbList = new List(); public static List OldOrbList = new List(); public static Dictionary OrbUserList = new Dictionary(); public static void AddObject(WorldObject worldObject) { if (_worldObjects.Contains(worldObject)) { return; } _worldObjects.Add(worldObject); } public static IEnumerable GetObjects() { return _worldObjects.OfType(); } public static T GetObject(int id) where T : WorldObject { return GetObjects().FirstOrDefault(x => x.ObjectId == id); } public static bool IsOrbControlledLocally(NomaiInterfaceOrb orb) { return OrbUserList[orb] == PlayerRegistry.LocalPlayerId; } } }