public MyObjectBuilder_FactionChatHistory GetObjectBuilder() { var objectBuilder = new MyObjectBuilder_FactionChatHistory(); objectBuilder.Chat = new List<MyObjectBuilder_FactionChatItem>(m_chat.Count); foreach (var chatItem in m_chat) { if (chatItem.PlayersToSendTo != null && chatItem.PlayersToSendTo.Count > 0) { objectBuilder.Chat.Add(chatItem.GetObjectBuilder()); } } objectBuilder.FactionId1 = m_factionId1; objectBuilder.FactionId2 = m_factionId2; return objectBuilder; }
public MyFactionChatHistory(MyObjectBuilder_FactionChatHistory chatBuilder) : this(chatBuilder.FactionId1, chatBuilder.FactionId2) { if (chatBuilder.Chat != null) { m_chat = new Queue<MyFactionChatItem>(chatBuilder.Chat.Count); foreach (var chatItem in chatBuilder.Chat) { MyFactionChatItem newChatItem = new MyFactionChatItem(); newChatItem.Init(chatItem); m_chat.Enqueue(newChatItem); } } else { m_chat = new Queue<MyFactionChatItem>(); } m_factionId1 = chatBuilder.FactionId1; m_factionId2 = chatBuilder.FactionId2; }