public void UseSurface(string surfaceName) { if (surfaceName == null) { Log("Surface name cannot be nil. Pass \"emucore\" to `gui.use_surface` to restore the default."); return; } _rememberedSurfaceID = DisplaySurfaceIDParser.Parse(surfaceName).Value; // iff param is not null, returns not null or throws }
public void UseSurface([LuaEnumStringParam] string surfaceName) { if (surfaceName == null) { Log("Surface name cannot be nil. Pass \"emucore\" to `gui.use_surface` to restore the default."); return; } _rememberedSurfaceID = DisplaySurfaceIDParser.Parse(surfaceName).Value; }
private DisplaySurfaceID UseOrFallback(string surfaceName) => DisplaySurfaceIDParser.Parse(surfaceName) ?? _rememberedSurfaceID;