2022-01-03 05:35:59 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2020-11-04 04:12:42 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
public abstract class BattleVideo : IPokeGroup
|
2016-11-10 16:14:54 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public abstract IReadOnlyList<PKM> BattlePKMs { get; }
|
|
|
|
|
public abstract int Generation { get; }
|
2016-11-10 16:14:54 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public IEnumerable<PKM> Contents => BattlePKMs;
|
2020-11-04 04:12:42 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public static BattleVideo? GetVariantBattleVideo(byte[] data)
|
|
|
|
|
{
|
|
|
|
|
if (BV6.IsValid(data))
|
|
|
|
|
return new BV6(data);
|
|
|
|
|
if (BV7.IsValid(data))
|
|
|
|
|
return new BV7(data);
|
|
|
|
|
if (BV3.IsValid(data))
|
|
|
|
|
return new BV3(data);
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2016-11-10 16:14:54 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public static bool IsValid(ReadOnlySpan<byte> data)
|
|
|
|
|
{
|
|
|
|
|
if (BV6.IsValid(data))
|
|
|
|
|
return true;
|
|
|
|
|
if (BV7.IsValid(data))
|
|
|
|
|
return true;
|
|
|
|
|
if (BV3.IsValid(data))
|
|
|
|
|
return true;
|
|
|
|
|
return false;
|
2016-11-10 16:14:54 +00:00
|
|
|
|
}
|
|
|
|
|
}
|