2023-09-23 13:33:23 +00:00
|
|
|
using Tiger.Communication.Messages.Interfaces;
|
|
|
|
using Tiger.Communication.Messages.Types;
|
|
|
|
using Tiger.Game.Habbos;
|
|
|
|
|
|
|
|
namespace Tiger.Communication.Messages.Outgoing.Notifications;
|
|
|
|
|
|
|
|
public class ActivityPointsComposer : IMessageComposer
|
|
|
|
{
|
|
|
|
private readonly IEnumerable<Activitypoints>? _activitypoints;
|
|
|
|
|
|
|
|
public ActivityPointsComposer(IEnumerable<Activitypoints>? activitypoints)
|
|
|
|
{
|
|
|
|
_activitypoints = activitypoints;
|
|
|
|
}
|
|
|
|
|
|
|
|
public OutgoingHeaders Header => OutgoingHeaders.ActivityPointsMessageComposer;
|
|
|
|
public void Compose(ServerMessage message)
|
|
|
|
{
|
|
|
|
message.AppendInt32(_activitypoints?.Count() ?? 0);
|
|
|
|
|
|
|
|
if (_activitypoints == null) return;
|
|
|
|
|
|
|
|
foreach (var activitypoint in _activitypoints)
|
|
|
|
{
|
|
|
|
message.AppendInt32(activitypoint.Type);
|
2023-09-23 16:51:16 +00:00
|
|
|
message.AppendInt32(activitypoint.Amount);
|
2023-09-23 13:33:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|