mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-23 01:05:47 +00:00
2989c163a8
* editorconfig: Add default charset * Change file encoding from UTF-8-BOM to UTF-8
32 lines
787 B
C#
32 lines
787 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();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|