TigerEmu/Communication/Messages/Outgoing/Navigator/UserFlatCatsComposer.cs

27 lines
739 B
C#

using Tiger.Communication.Messages.Interfaces;
using Tiger.Communication.Messages.Types;
using Tiger.Game.Navigator.Nodes;
namespace Tiger.Communication.Messages.Outgoing.Navigator;
public class UserFlatCatsComposer : IMessageComposer
{
private readonly ICollection<NavigatorNode> _flatCats;
public UserFlatCatsComposer(ICollection<NavigatorNode> flatCats)
{
_flatCats = flatCats;
}
public OutgoingHeaders Header => OutgoingHeaders.UserFlatCats;
public void Compose(ServerMessage message)
{
message.AppendWire(_flatCats.Count);
foreach (var flatCat in _flatCats)
{
message.AppendWire(flatCat.Id);
message.AppendString(flatCat.Name);
}
}
}