30 lines
830 B
C#
30 lines
830 B
C#
using Tiger.Communication.Messages.Interfaces;
|
|
using Tiger.Communication.Messages.Types;
|
|
using Tiger.Game.Habbos;
|
|
|
|
namespace Tiger.Communication.Messages.Outgoing.User.Data;
|
|
|
|
public class UserCurrentBadgesComposer : IMessageComposer
|
|
{
|
|
private readonly int _habboId;
|
|
private readonly ICollection<Badge> _badges;
|
|
|
|
public UserCurrentBadgesComposer(int habboId, ICollection<Badge> badges)
|
|
{
|
|
_habboId = habboId;
|
|
_badges = badges;
|
|
}
|
|
|
|
public OutgoingHeaders Header => OutgoingHeaders.UserBadgesCurrent;
|
|
public void Compose(ServerMessage message)
|
|
{
|
|
message.AppendInt32(_habboId);
|
|
message.AppendInt32(_badges.Count);
|
|
|
|
foreach (var badge in _badges)
|
|
{
|
|
message.AppendInt32(badge.Slot);
|
|
message.AppendString(badge.Code);
|
|
}
|
|
}
|
|
} |