Simplification

invalid/unknown usages were incorrectly interchangable; dex-sets were
looking at Unknown which was impossible for some cases.

only use GameVersion.Unknown as a temp placeholder for later resolution
by the user.
This commit is contained in:
Kurt 2018-03-11 18:07:48 -07:00
parent 22bde0af52
commit 102550174e
11 changed files with 13 additions and 14 deletions

View file

@ -99,7 +99,7 @@
case 6: return GameVersion.AS;
case 7: return GameVersion.UM;
default:
return GameVersion.Unknown;
return GameVersion.Invalid;
}
}
public static int GetGeneration(GameVersion game)

View file

@ -480,7 +480,7 @@ namespace PKHeX.Core
return false;
if (species > MaxSpeciesID)
return false;
if (Version == GameVersion.Unknown)
if (Version == GameVersion.Invalid)
return false;
return true;
}

View file

@ -484,7 +484,7 @@ namespace PKHeX.Core
return false;
if (species > MaxSpeciesID)
return false;
if (Version == GameVersion.Unknown)
if (Version == GameVersion.Invalid)
return false;
return true;
}

View file

@ -187,7 +187,6 @@ namespace PKHeX.Core
// Configuration
public override SaveFile Clone() { return new SAV3(Write(DSV:false), Version) {Japanese = Japanese}; }
public override bool IndeterminateGame => Version == GameVersion.Unknown;
public override bool IndeterminateSubVersion => Version == GameVersion.FRLG;
public override int SIZE_STORED => PKX.SIZE_3STORED;
@ -529,7 +528,7 @@ namespace PKHeX.Core
return false;
if (species > MaxSpeciesID)
return false;
if (Version == GameVersion.Unknown)
if (Version == GameVersion.Invalid)
return false;
if (BlockOfs.Any(z => z < 0))
return false;

View file

@ -792,7 +792,7 @@ namespace PKHeX.Core
return;
if (pkm.Species > MaxSpeciesID)
return;
if (Version == GameVersion.Unknown)
if (Version == GameVersion.Invalid)
return;
if (PokeDex < 0)
return;

View file

@ -405,7 +405,7 @@ namespace PKHeX.Core
return;
if (pkm.Species > MaxSpeciesID)
return;
if (Version == GameVersion.Unknown)
if (Version == GameVersion.Invalid)
return;
if (PokeDex < 0)
return;

View file

@ -242,7 +242,7 @@ namespace PKHeX.Core
case 26: return GameVersion.AS;
case 27: return GameVersion.OR;
}
return GameVersion.Unknown;
return GameVersion.Invalid;
}
}
@ -710,7 +710,7 @@ namespace PKHeX.Core
return;
if (pkm.Species > MaxSpeciesID)
return;
if (Version == GameVersion.Unknown)
if (Version == GameVersion.Invalid)
return;
const int brSize = 0x60;

View file

@ -275,7 +275,7 @@ namespace PKHeX.Core
case 32: return GameVersion.US;
case 33: return GameVersion.UM;
}
return GameVersion.Unknown;
return GameVersion.Invalid;
}
}
@ -970,7 +970,7 @@ namespace PKHeX.Core
}
protected override void SetDex(PKM pkm)
{
if (PokeDex < 0 || Version == GameVersion.Unknown) // sanity
if (PokeDex < 0 || Version == GameVersion.Invalid) // sanity
return;
if (pkm.Species == 0 || pkm.Species > MaxSpeciesID) // out of range
return;

View file

@ -26,7 +26,7 @@ namespace PKHeX.Core
public byte[] Header { protected get; set; } = new byte[0]; // .gci
public bool Japanese { get; protected set; }
protected virtual string PlayTimeString => $"{PlayedHours}ː{PlayedMinutes:00}ː{PlayedSeconds:00}"; // not :
public virtual bool IndeterminateGame => false;
public bool IndeterminateGame => Version == GameVersion.Unknown;
public virtual bool IndeterminateSubVersion => false;
public abstract string Extension { get; }
public virtual string[] PKMExtensions => PKM.Extensions.Where(f =>

View file

@ -974,7 +974,7 @@ namespace PKHeX.Core
case 9: return (int)GameVersion.R;
case 10: return (int)GameVersion.E;
case 11: return (int)GameVersion.CXD;
default: return (int)GameVersion.Unknown;
default: return (int)GameVersion.Invalid;
}
}

View file

@ -1666,7 +1666,7 @@ namespace PKHeX.WinForms.Controls
public void ChangeLanguage(SaveFile sav, PKM pk)
{
// Force an update to the met locations
origintrack = GameVersion.Unknown;
origintrack = GameVersion.Invalid;
bool alreadyInit = FieldsInitialized;
FieldsInitialized = false;