forked from project-redbud/FunGame-Core
添加get;
This commit is contained in:
parent
8938581805
commit
8570b72e2b
@ -31,9 +31,13 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public new object this[string key]
|
||||
public new object? this[string key]
|
||||
{
|
||||
set => Add(key, value);
|
||||
get => GetValue(key);
|
||||
set
|
||||
{
|
||||
if (value != null) Add(key, value);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -53,6 +57,20 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取指定key的value
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public object? GetValue(string key)
|
||||
{
|
||||
if (base.TryGetValue(key, out object? value) && value != null)
|
||||
{
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用泛型获取指定key的value
|
||||
/// </summary>
|
||||
|
||||
@ -828,6 +828,13 @@
|
||||
<typeparam name="T"></typeparam>
|
||||
<param name="key"></param>
|
||||
</member>
|
||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.PluginConfig.GetValue(System.String)">
|
||||
<summary>
|
||||
获取指定key的value
|
||||
</summary>
|
||||
<param name="key"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:Milimoe.FunGame.Core.Api.Utility.PluginConfig.Get``1(System.String)">
|
||||
<summary>
|
||||
使用泛型获取指定key的value
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user