// // Licensed under the MIT License. See LICENSE file in the project root for full license information. // namespace MUnique.OpenMU.PlugIns.Tests; using System.ComponentModel.DataAnnotations; using System.Runtime.InteropServices; using MUnique.OpenMU.GameLogic; using MUnique.OpenMU.PlugIns; /// /// The implementation of the which tells us if it got executed. /// /// [Guid("9FCA692F-2BD5-4310-8755-E20761F94180")] [PlugIn] [Display(Name = nameof(ExamplePlugIn), Description = "Just an example plugin.")] internal class ExamplePlugIn : IExamplePlugIn { /// /// Gets a value indicating whether the plugin instance was executed in the test. /// public bool WasExecuted { get; private set; } /// public void DoStuff(Player player, string text, MyEventArgs args) { this.WasExecuted = true; args.WasExecuted = true; } /// /// A plugin of a nested type. /// /// [Guid("B6D7E11D-E99D-4466-BAE1-87B043ED345D")] [PlugIn] [Display(Name = nameof(NestedPlugIn), Description = "A nested example plugin.")] internal class NestedPlugIn : IExamplePlugIn { /// public void DoStuff(Player player, string text, MyEventArgs args) { // do nothing } } /// /// A plugin of a nested type which doesn't have a guid. /// /// [PlugIn] [Display(Name = nameof(NestedPlugIn), Description = "A nested example plugin without Guid.")] internal class NestedWithoutGuid : IExamplePlugIn { /// public void DoStuff(Player player, string text, MyEventArgs args) { // does nothing, too } } }