init
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace RPGCoreCommon.DynamicValues
|
||||
{
|
||||
public class DynamicValueSourceContext
|
||||
{
|
||||
private readonly Dictionary<string, object> _sources = new();
|
||||
|
||||
public void SetSource(string name, object source)
|
||||
{
|
||||
_sources.Remove(name.ToLower());
|
||||
_sources.Add(name.ToLower(), source);
|
||||
}
|
||||
|
||||
public void RemoveResource(string name)
|
||||
{
|
||||
_sources.Remove(name.ToLower());
|
||||
}
|
||||
|
||||
public void RemoveSources()
|
||||
{
|
||||
_sources.Clear();
|
||||
}
|
||||
|
||||
public bool TryGetSource(string name, out object source)
|
||||
{
|
||||
return _sources.TryGetValue(name.ToLower(), out source);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user