PKHeX/PKHeX.Core/Saves/Substructures/Battle Videos/BattleVideo.cs
2024-03-08 00:53:35 -06:00

36 lines
1,005 B
C#

using System;
namespace PKHeX.Core;
public static class BattleVideo
{
public static IBattleVideo? GetVariantBattleVideo(byte[] data)
{
if (BattleVideo7.IsValid(data))
return new BattleVideo7(data);
if (BattleVideo6.IsValid(data))
return new BattleVideo6(data);
if (BattleVideo5.IsValid(data))
return new BattleVideo5(data);
if (BattleVideo4.IsValid(data))
return new BattleVideo4(data);
if (BattleVideo3.IsValid(data))
return new BattleVideo3(data);
return null;
}
public static bool IsValid(ReadOnlySpan<byte> data)
{
if (BattleVideo7.IsValid(data))
return true;
if (BattleVideo6.IsValid(data))
return true;
if (BattleVideo5.IsValid(data))
return true;
if (BattleVideo4.IsValid(data))
return true;
if (BattleVideo3.IsValid(data))
return true;
return false;
}
}