Files
mROA/mROA/Implementation/StaticRepresentationModuleProducer.cs
T

23 lines
698 B
C#
Raw Normal View History

using System;
using mROA.Abstract;
2025-02-17 16:52:58 +03:00
namespace mROA.Implementation
2025-02-17 16:52:58 +03:00
{
public class StaticRepresentationModuleProducer : IRepresentationModuleProducer
2025-02-17 16:52:58 +03:00
{
private IRepresentationModule? _representationModule;
2025-03-13 20:01:17 +03:00
public IRepresentationModule Produce(int ownership)
{
if (_representationModule == null)
throw new NullReferenceException("The representation module is not initialized.");
return _representationModule;
}
2025-03-13 20:01:17 +03:00
public void Inject<T>(T dependency)
{
if (dependency is IRepresentationModule serialisationModule)
_representationModule = serialisationModule;
}
2025-02-17 16:52:58 +03:00
}
}