[gnome-games] retro: Add RetroCore
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] retro: Add RetroCore
- Date: Sun, 14 Jun 2020 13:18:54 +0000 (UTC)
commit 144be27d5f814e4a6ff1ba6f021cea32825f0665
Author: Adwait Rawat <adwait rawat gmail com>
Date: Thu Jun 11 02:39:19 2020 +0900
retro: Add RetroCore
Added RetroCore class, a wrapper class for Retro.CoreDescriptor
functions that will be used in FirmwareManager class for
abstraction and generalization of code.
src/meson.build | 1 +
src/retro/retro-core.vala | 41 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+)
---
diff --git a/src/meson.build b/src/meson.build
index 056c46bb..5d56f024 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -78,6 +78,7 @@ vala_sources = [
'keyboard/keyboard-mapping-builder.vala',
'keyboard/keyboard-mapping-manager.vala',
+ 'retro/retro-core.vala',
'retro/retro-core-manager.vala',
'retro/retro-core-source.vala',
'retro/retro-error.vala',
diff --git a/src/retro/retro-core.vala b/src/retro/retro-core.vala
new file mode 100644
index 00000000..d97099b8
--- /dev/null
+++ b/src/retro/retro-core.vala
@@ -0,0 +1,41 @@
+// This file is part of GNOME Games. License: GPL-3.0+
+
+private class Games.RetroCore : Object, Core {
+ private Retro.CoreDescriptor core_descriptor;
+
+ public RetroCore (Retro.CoreDescriptor core_descriptor) {
+ this.core_descriptor = core_descriptor;
+ }
+
+ public string[] get_all_firmware (Platform platform) throws Error {
+ var platform_id = platform.get_id ();
+ if (core_descriptor.has_firmwares (platform_id))
+ return core_descriptor.get_firmwares (platform_id);
+ else
+ return {};
+ }
+
+ public bool has_firmware_md5 (string firmware) throws Error {
+ return core_descriptor.has_firmware_md5 (firmware);
+ }
+
+ public bool has_firmware_sha512 (string firmware) throws Error {
+ return core_descriptor.has_firmware_sha512 (firmware);
+ }
+
+ public string? get_firmware_md5 (string firmware) throws Error {
+ return core_descriptor.get_firmware_md5 (firmware);
+ }
+
+ public string? get_firmware_sha512 (string firmware) throws Error {
+ return core_descriptor.get_firmware_sha512 (firmware);
+ }
+
+ public bool get_is_firmware_mandatory (string firmware) throws Error {
+ return core_descriptor.get_is_firmware_mandatory (firmware);
+ }
+
+ public string? get_firmware_path (string firmware) throws Error {
+ return core_descriptor.get_firmware_path (firmware);
+ }
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]