//
// SharedOptions.cs
//
// Copyright (c) František Boháček. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.Extensions.DependencyInjection;
using NosSmooth.Data.NOSFiles;
using NosSmooth.LocalBinding;
using NosSmooth.PacketSerializer.Packets;
namespace NosSmooth.Extensions.SharedBinding;
///
/// Options for .
///
internal class SharedOptions
{
private Dictionary _descriptors = new();
///
/// Add service descriptor for given type.
///
/// The service descriptor.
public void AddDescriptor(ServiceDescriptor descriptor)
{
var type = descriptor.ServiceType;
if (_descriptors.ContainsKey(type))
{
return;
}
_descriptors[type] = descriptor;
}
///
/// Get descriptor for the given type.
///
/// The type of the descriptor.
/// A descriptor.
public ServiceDescriptor GetDescriptor(Type type)
{
return _descriptors[type];
}
}