//
// PinitSubPacket.cs
//
// Copyright (c) František Boháček. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using NosSmooth.Packets.Enums;
using NosSmooth.Packets.Enums.Entities;
using NosSmooth.Packets.Enums.Mates;
using NosSmooth.Packets.Enums.Players;
using NosSmooth.PacketSerializer.Abstractions.Attributes;
using NosSmooth.PacketSerializer.Abstractions.Common;
namespace NosSmooth.Packets.Server.Groups;
///
/// Sub packet of containing information
/// about one of the group members.
///
/// The type of the entity.
/// The id of the entity.
/// Present for pets and partners.
/// Present for players.
[PacketHeader(null, PacketSource.Server)]
[GenerateSerializer(true)]
public record PinitSubPacket
(
[PacketIndex(0)]
EntityType EntityType,
[PacketIndex(1)]
long EntityId,
[PacketConditionalIndex(2, "EntityType", false, EntityType.Npc, IsOptional = true)]
PinitMateSubPacket? MateSubPacket,
[PacketConditionalIndex(3, "EntityType", false, EntityType.Player, IsOptional = true)]
PinitPlayerSubPacket? PlayerSubPacket
) : IPacket;