Example #1
0
        /// <inheritdoc />
        public TextChatEventData CreateChatData <TMessageType>([NotNull] EntityAssociatedData <TMessageType> incomingChatMessageEventData, [NotNull] string associatedEntityName)
            where TMessageType : ITextMessageContainable, IChatChannelAssociatable
        {
            if (incomingChatMessageEventData == null)
            {
                throw new ArgumentNullException(nameof(incomingChatMessageEventData));
            }
            if (associatedEntityName == null)
            {
                throw new ArgumentNullException(nameof(associatedEntityName));
            }

            ChatMessageType messageType = MessageTypeFromChannel(incomingChatMessageEventData.Data.TargetChannel);

            string renderableMessage = $"<color=#{ComputeColorFromChatType(messageType)}>{ComputeChannelText(messageType)} {associatedEntityName}: {incomingChatMessageEventData.Data.Message}</color>";

            return(new TextChatEventData(renderableMessage, incomingChatMessageEventData.EntityGuid, messageType));
        }
 public ZoneChatMessageEventModel([JetBrains.Annotations.NotNull] EntityAssociatedData <TargetlessChannelChatMessageRequestModel> channelMessage)
     : base(channelMessage)
 {
 }
Example #3
0
        }                                                                                                                    //for Unity3D purposes this must not be private

        /// <inheritdoc />
        public TargetlessChannelChatMessageEventModel([JetBrains.Annotations.NotNull] EntityAssociatedData <TargetlessChannelChatMessageRequestModel> channelMessage)
        {
            ChannelMessage = channelMessage ?? throw new ArgumentNullException(nameof(channelMessage));
        }