[gnome-games] master-system: Add is_master_system() to MasterSystemRegion



commit 3ad931be1372da685994032f958f5d65abf94d4a
Author: Adrien Plazas <kekun plazas laposte net>
Date:   Wed Aug 3 10:21:35 2016 +0200

    master-system: Add is_master_system() to MasterSystemRegion
    
    This will be used in the next commit to discriminte Master System
    headers from Game Gear ones.

 .../master-system/src/master-system-header.vala    |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/plugins/master-system/src/master-system-header.vala 
b/plugins/master-system/src/master-system-header.vala
index ded175f..a261d45 100644
--- a/plugins/master-system/src/master-system-header.vala
+++ b/plugins/master-system/src/master-system-header.vala
@@ -68,6 +68,16 @@ private class Games.MasterSystemHeader : Object {
                if (!stream.has_string (MAGIC_OFFSET, MAGIC_VALUE))
                        throw new MasterSystemError.INVALID_HEADER (_("The file doesn't have a Master System 
header."));
        }
+
+       public bool is_master_system () {
+               switch (region_code) {
+               case MasterSystemRegion.SMS_JAPAN:
+               case MasterSystemRegion.SMS_EXPORT:
+                       return true;
+               default:
+                       return false;
+               }
+       }
 }
 
 private enum Games.MasterSystemRegion {


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