2022-06-18 18:04:24 +00:00
|
|
|
|
namespace PKHeX.Core;
|
|
|
|
|
|
|
|
|
|
public sealed class BattleBox6 : SaveBlock<SAV6>
|
2020-05-25 00:11:39 +00:00
|
|
|
|
{
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public BattleBox6(SAV6XY SAV, int offset) : base(SAV) => Offset = offset;
|
|
|
|
|
public BattleBox6(SAV6AO SAV, int offset) : base(SAV) => Offset = offset;
|
2020-05-25 00:11:39 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
private int LockedFlagOffset => Offset + (6 * PokeCrypto.SIZE_6STORED);
|
2020-05-25 00:11:39 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public bool Locked
|
|
|
|
|
{
|
|
|
|
|
get => LockedWiFiTournament || LockedLiveTournament;
|
|
|
|
|
set => LockedWiFiTournament = LockedLiveTournament = value;
|
|
|
|
|
}
|
2020-05-25 00:11:39 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public bool LockedWiFiTournament
|
|
|
|
|
{
|
|
|
|
|
get => (Data[LockedFlagOffset] & 1) != 0;
|
|
|
|
|
set => Data[LockedFlagOffset] = (byte)((Data[Offset + LockedFlagOffset] & ~1) | (value ? 1 : 0));
|
|
|
|
|
}
|
2020-05-25 00:11:39 +00:00
|
|
|
|
|
2022-06-18 18:04:24 +00:00
|
|
|
|
public bool LockedLiveTournament
|
|
|
|
|
{
|
|
|
|
|
get => (Data[LockedFlagOffset] & 2) != 0;
|
|
|
|
|
set => Data[LockedFlagOffset] = (byte)((Data[Offset + LockedFlagOffset] & ~2) | (value ? 2 : 0));
|
2020-05-25 00:11:39 +00:00
|
|
|
|
}
|
|
|
|
|
}
|