mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Allow content to ignore prototype-types.
This commit is contained in:
@@ -6,7 +6,7 @@ namespace SS14.Server.Prototypes
|
||||
{
|
||||
public ServerPrototypeManager() : base()
|
||||
{
|
||||
IgnoredPrototypeTypes.Add("shader");
|
||||
RegisterIgnore("shader");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,11 @@ namespace SS14.Shared.Prototypes
|
||||
/// Syncs all inter-prototype data. Call this when operations adding new prototypes are done.
|
||||
/// </summary>
|
||||
void Resync();
|
||||
|
||||
/// <summary>
|
||||
/// Registers a specific prototype name to be ignored.
|
||||
/// </summary>
|
||||
void RegisterIgnore(string name);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -96,7 +101,7 @@ namespace SS14.Shared.Prototypes
|
||||
private readonly Dictionary<Type, List<IPrototype>> prototypes = new Dictionary<Type, List<IPrototype>>();
|
||||
private readonly Dictionary<Type, Dictionary<string, IIndexedPrototype>> indexedPrototypes = new Dictionary<Type, Dictionary<string, IIndexedPrototype>>();
|
||||
|
||||
protected readonly HashSet<string> IgnoredPrototypeTypes = new HashSet<string>();
|
||||
private readonly HashSet<string> IgnoredPrototypeTypes = new HashSet<string>();
|
||||
|
||||
public IEnumerable<T> EnumeratePrototypes<T>() where T : class, IPrototype
|
||||
{
|
||||
@@ -296,6 +301,11 @@ namespace SS14.Shared.Prototypes
|
||||
prototype = (T)uncast;
|
||||
return returned;
|
||||
}
|
||||
|
||||
public void RegisterIgnore(string name)
|
||||
{
|
||||
IgnoredPrototypeTypes.Add(name);
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
|
||||
Reference in New Issue
Block a user