SystemLookup.cs - pointless refactoring
This commit is contained in:
parent
7662de47ca
commit
81bcf45d53
|
@ -8,55 +8,50 @@ namespace BizHawk.Emulation.Common
|
|||
{
|
||||
private readonly List<SystemInfo> _systems = new List<SystemInfo>
|
||||
{
|
||||
new SystemInfo { SystemId = "A26", FullName = "Atari 2600" },
|
||||
new SystemInfo { SystemId = "A78", FullName = "Atari 7800" },
|
||||
new SystemInfo { SystemId = "Lynx", FullName = "Atari Lynx" },
|
||||
|
||||
new SystemInfo { SystemId = "NES", FullName = "NES" },
|
||||
new SystemInfo { SystemId = "SNES", FullName = "Super NES" },
|
||||
new SystemInfo { SystemId = "N64", FullName = "Nintendo 64" },
|
||||
|
||||
new SystemInfo { SystemId = "GB", FullName = "Gameboy" },
|
||||
new SystemInfo { SystemId = "GBA", FullName = "Gameboy Advance" },
|
||||
|
||||
new SystemInfo { SystemId = "PSX", FullName = "Playstation" },
|
||||
|
||||
new SystemInfo { SystemId = "SMS", FullName = "Sega Master System" },
|
||||
new SystemInfo { SystemId = "GEN", FullName = "Sega Genesis/Mega Drive" },
|
||||
new SystemInfo { SystemId = "32X", FullName = "Sega Genesis 32X/Mega Drive 32X" },
|
||||
new SystemInfo { SystemId = "SAT", FullName = "Sega Saturn" },
|
||||
|
||||
new SystemInfo { SystemId = "PCE", FullName = "PC Engine/TurboGrafx 16" },
|
||||
new SystemInfo { SystemId = "Coleco", FullName = "ColecoVision" },
|
||||
new SystemInfo { SystemId = "TI83", FullName = "TI-83 Calculator" },
|
||||
new SystemInfo { SystemId = "WSWAN", FullName = "WonderSwan" },
|
||||
|
||||
new SystemInfo { SystemId = "C64", FullName = "Commodore 64" },
|
||||
new SystemInfo { SystemId = "AppleII", FullName = "Apple II" },
|
||||
new SystemInfo { SystemId = "INTV", FullName = "IntelliVision" },
|
||||
new SystemInfo { SystemId = "ZXSpectrum", FullName = "Sinclair ZX Spectrum" },
|
||||
new SystemInfo { SystemId = "AmstradCPC", FullName = "Amstrad CPC" },
|
||||
new SystemInfo { SystemId = "ChannelF", FullName = "Fairchild Channel F"},
|
||||
new SystemInfo { SystemId = "O2", FullName = "Odyssey2"},
|
||||
new SystemInfo { SystemId = "VEC", FullName = "Vectrex"},
|
||||
new SystemInfo { SystemId = "MSX", FullName = "MSX"}
|
||||
new SystemInfo("A26", "Atari 2600"),
|
||||
new SystemInfo("A78", "Atari 7800"),
|
||||
new SystemInfo("Lynx", "Atari Lynx"),
|
||||
new SystemInfo("NES", "NES"),
|
||||
new SystemInfo("SNES", "Super NES"),
|
||||
new SystemInfo("N64", "Nintendo 64"),
|
||||
new SystemInfo("GB", "Gameboy"),
|
||||
new SystemInfo("GBA", "Gameboy Advance"),
|
||||
new SystemInfo("PSX", "Playstation"),
|
||||
new SystemInfo("SMS", "Sega Master System"),
|
||||
new SystemInfo("GEN", "Sega Genesis/Mega Drive"),
|
||||
new SystemInfo("32X", "Sega Genesis 32X/Mega Drive 32X"),
|
||||
new SystemInfo("SAT", "Sega Saturn"),
|
||||
new SystemInfo("PCE", "PC Engine/TurboGrafx 16"),
|
||||
new SystemInfo("Coleco", "ColecoVision"),
|
||||
new SystemInfo("TI83", "TI-83 Calculator"),
|
||||
new SystemInfo("WSWAN", "WonderSwan"),
|
||||
new SystemInfo("C64", "Commodore 64"),
|
||||
new SystemInfo("AppleII", "Apple II"),
|
||||
new SystemInfo("INTV", "IntelliVision"),
|
||||
new SystemInfo("ZXSpectrum", "Sinclair ZX Spectrum"),
|
||||
new SystemInfo("AmstradCPC", "Amstrad CPC"),
|
||||
new SystemInfo("ChannelF", "Fairchild Channel F"),
|
||||
new SystemInfo("O2", "Odyssey2"),
|
||||
new SystemInfo("VEC", "Vectrex"),
|
||||
new SystemInfo("MSX", "MSX")
|
||||
};
|
||||
|
||||
public SystemInfo this[string systemId]
|
||||
{
|
||||
get
|
||||
{
|
||||
var system = _systems.FirstOrDefault(s => s.SystemId == systemId);
|
||||
return system ?? new SystemInfo { SystemId = "Unknown", FullName = "Unknown" };
|
||||
}
|
||||
}
|
||||
=> _systems.FirstOrDefault(s => s.SystemId == systemId)
|
||||
?? new SystemInfo("Unknown", "Unknown");
|
||||
|
||||
public IEnumerable<SystemInfo> AllSystems => _systems;
|
||||
|
||||
public class SystemInfo
|
||||
{
|
||||
public string SystemId { get; set; }
|
||||
public string FullName { get; set; }
|
||||
public SystemInfo(string systemId, string fullName)
|
||||
{
|
||||
SystemId = systemId;
|
||||
FullName = fullName;
|
||||
}
|
||||
|
||||
public string SystemId { get; }
|
||||
public string FullName { get; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue