16 lines
395 B
C#
Raw Normal View History

2020-08-13 19:25:12 +02:00
using System.Collections.Generic;
using System.Linq;
namespace QSB.WorldSync
{
public static class WorldRegistry
{
public static List<WorldObject> WorldObjects { get; } = new List<WorldObject>();
2020-08-13 20:43:47 +02:00
public static T GetObject<T>(int id) where T : WorldObject
2020-08-13 19:25:12 +02:00
{
2020-08-13 20:47:23 +02:00
return WorldObjects.OfType<T>().FirstOrDefault(x => x.ObjectId == id);
2020-08-13 19:25:12 +02:00
}
}
}