Ryujinx/src/Ryujinx.Graphics.Host1x/Devices.cs
TSRBerry 0191e2396a
[Ryujinx.Graphics.Host1x] Address dotnet-format issues (#5368)
* dotnet format style --severity info

Some changes were manually reverted.

* Address most dotnet format whitespace warnings

* Add comments to disabled warnings

* dotnet format whitespace after rebase
2023-06-27 16:35:48 +02:00

32 lines
790 B
C#

using Ryujinx.Graphics.Device;
using System;
using System.Collections.Generic;
namespace Ryujinx.Graphics.Host1x
{
class Devices : IDisposable
{
private readonly Dictionary<ClassId, IDeviceState> _devices = new();
public void RegisterDevice(ClassId classId, IDeviceState device)
{
_devices[classId] = device;
}
public IDeviceState GetDevice(ClassId classId)
{
return _devices.TryGetValue(classId, out IDeviceState device) ? device : null;
}
public void Dispose()
{
foreach (var device in _devices.Values)
{
if (device is ThiDevice thi)
{
thi.Dispose();
}
}
}
}
}