[gnome-games] core: Add Platform
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] core: Add Platform
- Date: Fri, 3 Aug 2018 16:35:11 +0000 (UTC)
commit e91df9646e2680a9cb3c1dfee21969ac6388248e
Author: 1PunMan <saurabhsingh412 gmail com>
Date: Tue Jun 26 16:03:27 2018 +0530
core: Add Platform
This will be used later in a subsequent commit to create a generic
game storing its platform source.
src/core/platform.vala | 13 +++++++++++++
src/meson.build | 1 +
2 files changed, 14 insertions(+)
---
diff --git a/src/core/platform.vala b/src/core/platform.vala
new file mode 100644
index 00000000..d114af96
--- /dev/null
+++ b/src/core/platform.vala
@@ -0,0 +1,13 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+public interface Games.Platform : Object {
+ public abstract string get_name ();
+
+ public static uint hash (Platform platform) {
+ return str_hash (platform.get_name ());
+ }
+
+ public static bool equal (Platform a, Platform b) {
+ return str_equal (a.get_name (), b.get_name ());
+ }
+}
diff --git a/src/meson.build b/src/meson.build
index 8ee9af66..06949b20 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -29,6 +29,7 @@ vala_sources = [
'core/media-info.vala',
'core/media-set/media-set.vala',
'core/media-set/media-set-error.vala',
+ 'core/platform.vala',
'core/players.vala',
'core/plugin.vala',
'core/plugin-register.vala',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]