using Tiger.Communication.Messages.Interfaces; using Tiger.Communication.Messages.Types; using Tiger.Game.LandingView; namespace Tiger.Communication.Messages.Outgoing.Landingview; public class PromoArticlesComposer : IMessageComposer { private readonly ICollection _promoArticles; public PromoArticlesComposer(ICollection promoArticles) { _promoArticles = promoArticles; } public OutgoingHeaders Header => OutgoingHeaders.PromoArticlesMessageComposer; public void Compose(ServerMessage message) { message.AppendInt32(_promoArticles.Count); foreach (var promoArticle in _promoArticles) { message.AppendInt32(promoArticle.Id); message.AppendString(promoArticle.Title); message.AppendString(promoArticle.BodyText); message.AppendString(promoArticle.ButtonText); message.AppendInt32((int)promoArticle.LinkType); message.AppendString(promoArticle.LinkContent); message.AppendString(promoArticle.ImageUrl); } } }