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

27 lines
815 B
C#

using Tiger.Communication.Messages.Interfaces;
using Tiger.Communication.Messages.Types;
using Tiger.Game.Navigator.Views;
namespace Tiger.Communication.Messages.Outgoing.Navigator;
public class NavigatorMetadataComposer : IMessageComposer
{
private readonly ICollection<INavigatorView> _navigatorViews;
public NavigatorMetadataComposer(ICollection<INavigatorView> navigatorViews)
{
_navigatorViews = navigatorViews;
}
public OutgoingHeaders Header => OutgoingHeaders.NavigatorMetadata;
public void Compose(ServerMessage message)
{
message.AppendInt32(_navigatorViews.Count);
foreach (var navigatorView in _navigatorViews)
{
message.AppendString(navigatorView.Code);
message.AppendInt32(0); // saved searches
}
}
}