Allow ext. tools to recieve an ApiContainer

This commit is contained in:
YoshiRulz 2020-12-03 18:51:39 +10:00
parent 608d7dcff8
commit d4349aefd4
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 3 additions and 0 deletions

View File

@ -35,6 +35,9 @@ namespace BizHawk.Client.Common
Type targetType = target.GetType();
object[] tmp = new object[1];
targetType.GetProperties().FirstOrDefault(pi => pi.PropertyType == typeof(ApiContainer))
?.SetValue(target, source.Container);
foreach (var propinfo in targetType.GetPropertiesWithAttrib(typeof(RequiredApiAttribute)))
{
tmp[0] = source.GetApi(propinfo.PropertyType);