[gnome-games] game-boy: Add is_classic() to GameBoyHeader
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] game-boy: Add is_classic() to GameBoyHeader
- Date: Sat, 27 Aug 2016 20:26:24 +0000 (UTC)
commit e662b10cd3a4f07d597aae0ee93725e265b4f091
Author: Adrien Plazas <kekun plazas laposte net>
Date: Sat Aug 27 21:26:03 2016 +0200
game-boy: Add is_classic() to GameBoyHeader
This will be used in the next commits to discriminte GameBoy headers
from GameBoyColor ones.
https://bugzilla.gnome.org/show_bug.cgi?id=769495
plugins/game-boy/src/game-boy-header.vala | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/plugins/game-boy/src/game-boy-header.vala b/plugins/game-boy/src/game-boy-header.vala
index 27f1acf..9bc461f 100644
--- a/plugins/game-boy/src/game-boy-header.vala
+++ b/plugins/game-boy/src/game-boy-header.vala
@@ -96,6 +96,16 @@ private class Games.GameBoyHeader : Object {
if (!stream.has_string (MAGIC_OFFSET, MAGIC_VALUE))
throw new GameBoyError.INVALID_HEADER (_("The file doesn't have a Game Boy header."));
}
+
+ public bool is_classic () {
+ switch (game_boy_type) {
+ case GameBoyType.SUPER_ENABLED:
+ case GameBoyType.CLASSIC:
+ return true;
+ default:
+ return false;
+ }
+ }
}
private enum Games.GameBoyType {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]