[gnome-games/wip/exalm/ds: 5/15] platform: Add get_savestate_type()
- From: Alexander Mikhaylenko <alexm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/exalm/ds: 5/15] platform: Add get_savestate_type()
- Date: Wed, 14 Aug 2019 11:46:31 +0000 (UTC)
commit 9e405ba9196bfd9cc031185df89b5c6ef8266b5a
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date: Wed Aug 14 04:03:59 2019 +0500
platform: Add get_savestate_type()
This will be used in the next commit to allow platforms to have custom
savestate types.
Make the implementation in RetroPlatform virtual to allow overriding it
for Nintendo DS later.
src/core/platform.vala | 2 ++
src/dummy/dummy-platform.vala | 4 ++++
src/generic/generic-platform.vala | 4 ++++
src/retro/retro-platform.vala | 4 ++++
4 files changed, 14 insertions(+)
---
diff --git a/src/core/platform.vala b/src/core/platform.vala
index 6f07cec6..e9794622 100644
--- a/src/core/platform.vala
+++ b/src/core/platform.vala
@@ -9,6 +9,8 @@ public interface Games.Platform : Object {
public abstract PreferencesPagePlatformsRow get_row ();
+ public abstract Type get_savestate_type ();
+
public static uint hash (Platform platform) {
return str_hash (platform.get_id ());
}
diff --git a/src/dummy/dummy-platform.vala b/src/dummy/dummy-platform.vala
index 0b410867..82c2765c 100644
--- a/src/dummy/dummy-platform.vala
+++ b/src/dummy/dummy-platform.vala
@@ -16,4 +16,8 @@ public class Games.DummyPlatform : Object, Platform {
public PreferencesPagePlatformsRow get_row () {
return new PreferencesPagePlatformsGenericRow (_("Unknown"));
}
+
+ public Type get_savestate_type () {
+ return typeof (Savestate);
+ }
}
diff --git a/src/generic/generic-platform.vala b/src/generic/generic-platform.vala
index 96b0412b..0721b89c 100644
--- a/src/generic/generic-platform.vala
+++ b/src/generic/generic-platform.vala
@@ -26,4 +26,8 @@ public class Games.GenericPlatform : Object, Platform {
public PreferencesPagePlatformsRow get_row () {
return new PreferencesPagePlatformsGenericRow (name);
}
+
+ public Type get_savestate_type () {
+ return typeof (Savestate);
+ }
}
diff --git a/src/retro/retro-platform.vala b/src/retro/retro-platform.vala
index a84838e4..dfbcad9f 100644
--- a/src/retro/retro-platform.vala
+++ b/src/retro/retro-platform.vala
@@ -32,4 +32,8 @@ public class Games.RetroPlatform : Object, Platform {
public PreferencesPagePlatformsRow get_row () {
return new PreferencesPagePlatformsRetroRow (this);
}
+
+ public virtual Type get_savestate_type () {
+ return typeof (Savestate);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]