[gnome-games/wip/aplazas/generic-game: 3/4] generic-game: Add setters and defaults for metadata
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games/wip/aplazas/generic-game: 3/4] generic-game: Add setters and defaults for metadata
- Date: Thu, 19 Jul 2018 19:20:00 +0000 (UTC)
commit 9abe54a8a721e8fc671517290f6f6301604addbb
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu Jul 19 20:36:49 2018 +0200
generic-game: Add setters and defaults for metadata
Data considered non-essential to the basic functionning of the
application gain setters and can default to dummy implementations.
This will allow to drop these from the constructor in the next commit.
src/generic/generic-game.vala | 42 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
---
diff --git a/src/generic/generic-game.vala b/src/generic/generic-game.vala
index 3e5a9bb..91193f3 100644
--- a/src/generic/generic-game.vala
+++ b/src/generic/generic-game.vala
@@ -45,29 +45,71 @@ public class Games.GenericGame : Object, Game {
}
public Icon get_icon () {
+ if (game_icon == null)
+ game_icon = new DummyIcon ();
+
return game_icon;
}
+ public void set_icon (Icon icon) {
+ game_icon = icon;
+ }
+
public Cover get_cover () {
+ if (game_cover == null)
+ game_cover = new DummyCover ();
+
return game_cover;
}
+ public void set_cover (Cover cover) {
+ game_cover = cover;
+ }
+
public ReleaseDate get_release_date () {
+ if (game_release_date == null)
+ game_release_date = new DummyReleaseDate ();
+
return game_release_date;
}
+ public void set_release_date (ReleaseDate release_date) {
+ game_release_date = release_date;
+ }
+
public Cooperative get_cooperative () {
+ if (game_cooperative == null)
+ game_cooperative = new DummyCooperative ();
+
return game_cooperative;
}
+ public void set_cooperative (Cooperative cooperative) {
+ game_cooperative = cooperative;
+ }
+
public Genre get_genre () {
+ if (game_genre == null)
+ game_genre = new DummyGenre ();
+
return game_genre;
}
+ public void set_genre (Genre genre) {
+ game_genre = genre;
+ }
+
public Players get_players () {
+ if (game_players == null)
+ game_players = new DummyPlayers ();
+
return game_players;
}
+ public void set_players (Players players) {
+ game_players = players;
+ }
+
public Runner get_runner () throws Error {
return game_runner;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]