Пример #1
0
        public RomVersion(string key)
        {
            MVer = MRom.Build.UNKNOWN;
            OVer = ORom.Build.UNKNOWN;
            Game = Game.Undefined;

            if (!key.Contains("."))
            {
                return;
            }

            var game_ver = key.Split(new char[] { '.' }, 1);

            if (Enum.TryParse(game_ver[0], out Game game))
            {
                Game = game;
            }

            switch (Game)
            {
            case Game.OcarinaOfTime:
                if (Enum.TryParse(game_ver[1], out ORom.Build oV))
                {
                    OVer = oV;
                }
                return;

            case Game.MajorasMask:
                if (Enum.TryParse(game_ver[1], out MRom.Build mV))
                {
                    MVer = mV;
                }
                return;
            }
        }
Пример #2
0
        public RomVersion(string game, string build)
        {
            if (game.ToLowerInvariant() == "oot" ||
                game == Game.OcarinaOfTime.ToString())
            {
                ORom.Build oVer;

                MVer = MRom.Build.UNKNOWN;
                if (Enum.TryParse(build, true, out oVer))
                {
                    Game = Game.OcarinaOfTime;
                    OVer = oVer;
                }
                else
                {
                    Game = Game.Undefined;
                    OVer = ORom.Build.UNKNOWN;
                }
            }
            else if (game.ToLowerInvariant() == "mm" ||
                     game == Game.MajorasMask.ToString())
            {
                MRom.Build mVer;

                OVer = ORom.Build.UNKNOWN;
                if (Enum.TryParse(build, true, out mVer))
                {
                    Game = Game.MajorasMask;
                    MVer = mVer;
                }
                else
                {
                    Game = Game.Undefined;
                    MVer = MRom.Build.UNKNOWN;
                }
            }
            else
            {
                Game = Game.Undefined;
                OVer = ORom.Build.UNKNOWN;
                MVer = MRom.Build.UNKNOWN;
            }
        }
Пример #3
0
 public RomVersion(Game game, string build)
 {
     if (game == Game.OcarinaOfTime)
     {
         MVer = MRom.Build.UNKNOWN;
         if (Enum.TryParse(build, true, out ORom.Build oVer))
         {
             Game = Game.OcarinaOfTime;
             OVer = oVer;
         }
         else
         {
             Game = Game.Undefined;
             OVer = ORom.Build.UNKNOWN;
         }
     }
     else if (game == Game.MajorasMask)
     {
         OVer = ORom.Build.UNKNOWN;
         if (Enum.TryParse(build, true, out MRom.Build mVer))
         {
             Game = Game.MajorasMask;
             MVer = mVer;
         }
         else
         {
             Game = Game.Undefined;
             MVer = MRom.Build.UNKNOWN;
         }
     }
     else
     {
         Game = Game.Undefined;
         OVer = ORom.Build.UNKNOWN;
         MVer = MRom.Build.UNKNOWN;
     }
 }
Пример #4
0
 private RomVersion(MRom.Build build)
 {
     Game = Game.MajorasMask;
     OVer = ORom.Build.UNKNOWN;
     MVer = build;
 }
Пример #5
0
 private RomVersion(ORom.Build build)
 {
     Game = Game.OcarinaOfTime;
     OVer = build;
     MVer = MRom.Build.UNKNOWN;
 }
Пример #6
0
 public MRom(string fileLocation, MRom.Build version)
     : base(fileLocation, version)
 {
     Scenes = 0x6E;
 }