mirror of
https://github.com/project-redbud/FunGame-Core.git
synced 2025-12-05 08:09:02 +00:00
添加get;
This commit is contained in:
parent
8938581805
commit
8570b72e2b
@ -31,9 +31,13 @@ namespace Milimoe.FunGame.Core.Api.Utility
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="key"></param>
|
/// <param name="key"></param>
|
||||||
/// <returns></returns>
|
/// <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>
|
/// <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>
|
/// <summary>
|
||||||
/// 使用泛型获取指定key的value
|
/// 使用泛型获取指定key的value
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@ -828,6 +828,13 @@
|
|||||||
<typeparam name="T"></typeparam>
|
<typeparam name="T"></typeparam>
|
||||||
<param name="key"></param>
|
<param name="key"></param>
|
||||||
</member>
|
</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)">
|
<member name="M:Milimoe.FunGame.Core.Api.Utility.PluginConfig.Get``1(System.String)">
|
||||||
<summary>
|
<summary>
|
||||||
使用泛型获取指定key的value
|
使用泛型获取指定key的value
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user