baseline: OpenMU upstream b5a0961 (fresh source)

This commit is contained in:
Acentech Dev
2026-07-14 19:00:35 +03:00
parent 450402e47d
commit 36fc125d5c
11968 changed files with 748705 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
// <copyright file="CustomTestPlugInContainer.cs" company="MUnique">
// Licensed under the MIT License. See LICENSE file in the project root for full license information.
// </copyright>
namespace MUnique.OpenMU.PlugIns.Tests;
/// <summary>
/// A test implementation of a <see cref="CustomPlugInContainerBase{TPlugIn}"/>.
/// </summary>
public class CustomTestPlugInContainer : CustomPlugInContainerBase<ICustomTestPlugInContainer>
{
/// <summary>
/// Initializes a new instance of the <see cref="CustomTestPlugInContainer"/> class.
/// </summary>
/// <param name="manager">The plugin manager which manages this instance.</param>
public CustomTestPlugInContainer(PlugInManager manager)
: base(manager)
{
this.Initialize();
}
/// <summary>
/// Gets or sets a value indicating whether this instance creates new plug ins in <see cref="CreatePlugInIfSuitable"/>.
/// </summary>
public bool CreateNewPlugIns { get; set; } = true;
/// <inheritdoc />
protected override void CreatePlugInIfSuitable(Type plugInType)
{
if (this.CreateNewPlugIns)
{
this.AddPlugIn((ITestCustomPlugIn)Activator.CreateInstance(plugInType)!, true);
}
}
/// <inheritdoc />
protected override ICustomTestPlugInContainer? DetermineEffectivePlugIn(Type interfaceType)
{
return this.ActivePlugIns.FirstOrDefault(interfaceType.IsInstanceOfType);
}
/// <inheritdoc />
protected override bool IsNewPlugInReplacingOld(ICustomTestPlugInContainer currentEffectivePlugIn, ICustomTestPlugInContainer activatedPlugIn)
{
return true;
}
}