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; } }
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; } }
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; } }
private RomVersion(MRom.Build build) { Game = Game.MajorasMask; OVer = ORom.Build.UNKNOWN; MVer = build; }
private RomVersion(ORom.Build build) { Game = Game.OcarinaOfTime; OVer = build; MVer = MRom.Build.UNKNOWN; }
public MRom(string fileLocation, MRom.Build version) : base(fileLocation, version) { Scenes = 0x6E; }