36 lines
754 B
C#
36 lines
754 B
C#
using Autofac;
|
|
|
|
namespace MfGames.Nitride.Temporal.Setup;
|
|
|
|
public class NitrideTemporalModule : Module
|
|
{
|
|
private static bool loaded;
|
|
|
|
/// <inheritdoc />
|
|
protected override void Load(ContainerBuilder builder)
|
|
{
|
|
// Make sure our module isn't loaded more than once. This can happen
|
|
// if another module requires this one and the user adds this module
|
|
// to customize settings.
|
|
if (loaded)
|
|
{
|
|
return;
|
|
}
|
|
|
|
loaded = true;
|
|
|
|
// Make sure our module isn't loaded more than once.
|
|
builder.RegisterOperators(this);
|
|
builder.RegisterValidators(this);
|
|
|
|
builder
|
|
.RegisterType<TimeService>()
|
|
.AsSelf()
|
|
.SingleInstance();
|
|
|
|
builder
|
|
.RegisterGeneric(typeof(SetInstantFromComponent<>))
|
|
.As(typeof(SetInstantFromComponent<>));
|
|
}
|
|
}
|