Make an ISpecializedEmulatorService interface to show the intent of certain interfaces. In the core feature analysis, don't show these are unimplemented, as they aren't expected to be implemented by all cores. Make ILinkable inherit this interface.
Also check in ILinkable, I forgot to do that last time
This commit is contained in:
parent
f1f45afd83
commit
768905b2db
|
@ -169,19 +169,19 @@ namespace BizHawk.Client.EmuHawk
|
|||
.GetTypes()
|
||||
.Where(t => typeof(IEmulatorService).IsAssignableFrom(t))
|
||||
.Where(t => t != typeof(IEmulatorService))
|
||||
.Where(t => t.IsInterface)
|
||||
.Select(t => t.ToString());
|
||||
.Where(t => t.IsInterface);
|
||||
|
||||
var additionalServices = knownServies
|
||||
.Where(s => !ci.Services.ContainsKey(s))
|
||||
.Where(s => !ci.NotApplicableTypes.Contains(s));
|
||||
.Where(t => !ci.Services.ContainsKey(t.ToString()))
|
||||
.Where(t => !ci.NotApplicableTypes.Contains(t.ToString()))
|
||||
.Where(t => !typeof(ISpecializedEmulatorService).IsAssignableFrom(t)); // We don't want to show these as unimplemented, they aren't expected services
|
||||
|
||||
foreach (string servicename in additionalServices)
|
||||
foreach (Type service in additionalServices)
|
||||
{
|
||||
string img = "Bad";
|
||||
var serviceNode = new TreeNode
|
||||
{
|
||||
Text = servicename,
|
||||
Text = service.ToString(),
|
||||
ForeColor = Color.Red,
|
||||
ImageKey = img,
|
||||
SelectedImageKey = img,
|
||||
|
|
|
@ -22,6 +22,14 @@ namespace BizHawk.Emulation.Common
|
|||
public FeatureNotImplemented() { }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This represents a service that would not apply to every core, instead it is a specialized service specific to a core or group of cores
|
||||
/// This service is merely intended to define semantics and expectations of a service
|
||||
/// </summary>
|
||||
public interface ISpecializedEmulatorService : IEmulatorService
|
||||
{
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class ServiceNotApplicable : Attribute
|
||||
{
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
namespace BizHawk.Emulation.Common
|
||||
{
|
||||
public interface ILinkable : ISpecializedEmulatorService
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether or not the link cable is currently connected
|
||||
/// </summary>
|
||||
bool LinkConnected { get; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue