[gnome-games] dummy: Add DummyPlayers, DummyCoop, DummyGenre & DummyReleaseDate



commit e49fb0c952bb2f380bf37285264a039a22951883
Author: 1PunMan <saurabhsingh412 gmail com>
Date:   Tue Jun 26 03:14:18 2018 +0530

    dummy: Add DummyPlayers, DummyCoop, DummyGenre & DummyReleaseDate
    
    These will be used in a subsequent commit to create a generic game with no
    players field, coop status, genre or release date.

 po/POTFILES.in                    | 1 +
 src/dummy/dummy-coop.vala         | 7 +++++++
 src/dummy/dummy-genre.vala        | 7 +++++++
 src/dummy/dummy-players.vala      | 7 +++++++
 src/dummy/dummy-release-date.vala | 7 +++++++
 src/meson.build                   | 4 ++++
 6 files changed, 33 insertions(+)
---
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 79a2c7c..43227ba 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -42,6 +42,7 @@ plugins/wii/src/wii-header.vala
 src/command/command-runner.vala
 src/core/media-set/media-set.vala
 src/core/plugin-registrar.vala
+src/dummy/dummy-players.vala
 src/gameinfo/gameinfo-disc-id-disc-title.vala
 src/gameinfo/gameinfo-doc.vala
 src/retro/retro-core-source.vala
diff --git a/src/dummy/dummy-coop.vala b/src/dummy/dummy-coop.vala
new file mode 100644
index 0000000..a5aff93
--- /dev/null
+++ b/src/dummy/dummy-coop.vala
@@ -0,0 +1,7 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+public class Games.DummyCooperative : Object, Cooperative {
+       public bool get_cooperative () {
+               return false;
+       }
+}
diff --git a/src/dummy/dummy-genre.vala b/src/dummy/dummy-genre.vala
new file mode 100644
index 0000000..06849f9
--- /dev/null
+++ b/src/dummy/dummy-genre.vala
@@ -0,0 +1,7 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+public class Games.DummyGenre : Object, Genre {
+       public unowned List<string> get_genre () {
+               return null;
+       }
+}
diff --git a/src/dummy/dummy-players.vala b/src/dummy/dummy-players.vala
new file mode 100644
index 0000000..d32e5db
--- /dev/null
+++ b/src/dummy/dummy-players.vala
@@ -0,0 +1,7 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+public class Games.DummyPlayers : Object, Players {
+       public string get_players () {
+               return _("Not available");
+       }
+}
diff --git a/src/dummy/dummy-release-date.vala b/src/dummy/dummy-release-date.vala
new file mode 100644
index 0000000..895e684
--- /dev/null
+++ b/src/dummy/dummy-release-date.vala
@@ -0,0 +1,7 @@
+// This file is part of GNOME Games. License: GPL-3.0+.
+
+public class Games.DummyReleaseDate : Object, ReleaseDate {
+       public DateTime get_release_date () {
+               return new DateTime.utc (1970, 1, 1, 0, 0, 0);
+       }
+}
diff --git a/src/meson.build b/src/meson.build
index 7a2696c..ec3c984 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -45,9 +45,13 @@ vala_sources = [
   'database/database-uri-iterator.vala',
   'database/database-uri-source.vala',
 
+  'dummy/dummy-coop.vala',
   'dummy/dummy-cover.vala',
   'dummy/dummy-game.vala',
+  'dummy/dummy-genre.vala',
   'dummy/dummy-icon.vala',
+  'dummy/dummy-players.vala',
+  'dummy/dummy-release-date.vala',
   'dummy/dummy-runner.vala',
   'dummy/dummy-uid.vala',
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]