Exemplo n.º 1
0
        public void Init(MyObjectBuilder_ChatHistory chatBuilder)
        {
            if (chatBuilder != null)
            {
                m_identityId = chatBuilder.IdentityId;
            }

            if (chatBuilder != null && chatBuilder.PlayerChatHistory != null)
            {
                foreach (var playerChat in chatBuilder.PlayerChatHistory)
                {
                    m_playerChatHistory.Add(playerChat.IdentityId, new MyPlayerChatHistory(playerChat));
                }
            }

            if (chatBuilder != null && chatBuilder.GlobalChatHistory != null)
            {
                m_globalChatHistory.Init(chatBuilder.GlobalChatHistory);
            }
        }
Exemplo n.º 2
0
        public MyObjectBuilder_ChatHistory GetObjectBuilder()
        {
            var objectBuilder = new MyObjectBuilder_ChatHistory();

            objectBuilder.IdentityId = IdentityId;

            objectBuilder.PlayerChatHistory = new List<MyObjectBuilder_PlayerChatHistory>(m_playerChatHistory.Count);
            foreach (var playerChat in m_playerChatHistory.Values)
            {
                objectBuilder.PlayerChatHistory.Add(playerChat.GetObjectBuilder());
            }

            objectBuilder.GlobalChatHistory = m_globalChatHistory.GetObjectBuilder();
            return objectBuilder;
        }
Exemplo n.º 3
0
 public MyChatHistory(MyObjectBuilder_ChatHistory chatBuilder)
     : this(0)
 {
     Init(chatBuilder);
 }