using System.Collections.Generic;
using System.Reflection;
using SMAPI.Tests.ModApiProvider.Framework;
namespace SMAPI.Tests.ModApiProvider
{
/// A simulated mod instance.
public class ProviderMod
{
/// The underlying API instance.
private readonly SimpleApi Api = new();
/// Get the mod API instance.
public object GetModApi()
{
return this.Api;
}
/// Raise the event.
/// The value to send as an event argument.
public void RaiseEvent(int value)
{
this.Api.RaiseEventField(value);
}
/// Set the values for the API property.
public void SetPropertyValues(int number, object obj, string listValue, string listWithInterfaceValue, string dictionaryKey, string dictionaryListValue, BindingFlags enumValue, string inheritedValue)
{
this.Api.NumberProperty = number;
this.Api.ObjectProperty = obj;
this.Api.ListProperty = new List { listValue };
this.Api.ListPropertyWithInterface = new List { listWithInterfaceValue };
this.Api.GenericsProperty = new Dictionary> { [dictionaryKey] = new List { dictionaryListValue } };
this.Api.EnumProperty = enumValue;
this.Api.InheritedProperty = inheritedValue;
}
}
}