示例#1
0
        public MyObjectBuilder_GlobalChatHistory GetObjectBuilder()
        {
            var objectBuilder = new MyObjectBuilder_GlobalChatHistory();

            objectBuilder.Chat = new List<MyObjectBuilder_GlobalChatItem>(m_chat.Count);
            foreach (var chatItem in m_chat)
            {
                objectBuilder.Chat.Add(chatItem.GetObjectBuilder());
            }

            return objectBuilder;
        }
示例#2
0
 public void Init(MyObjectBuilder_GlobalChatHistory chatBuilder)
 {
     if (chatBuilder.Chat != null)
     {
         m_chat = new Queue<MyGlobalChatItem>(chatBuilder.Chat.Count);
         foreach (var chatItem in chatBuilder.Chat)
         {
             MyGlobalChatItem newChatItem = new MyGlobalChatItem();
             newChatItem.Init(chatItem);
             m_chat.Enqueue(newChatItem);
         }
     }
     else
     {
         m_chat = new Queue<MyGlobalChatItem>();
     }
 }