/// <inheritdoc /> /// <summary> /// Posts the specified message. /// </summary> /// <param name="characterSpawn">The character spawn.</param> /// <param name="text">The text.</param> /// <param name="type">The type.</param> public void Post(ICharacterSpawn characterSpawn, string text, SpeechType type) { ChannelPostingEventArgs channelPostingEventArgs = new ChannelPostingEventArgs(characterSpawn, type, text); Posting?.Invoke(this, channelPostingEventArgs); if (channelPostingEventArgs.Cancel) { return; } SendMessage(characterSpawn, channelPostingEventArgs.Text, channelPostingEventArgs.Type); ChannelPostedEventArgs channelPostedEventArgs = new ChannelPostedEventArgs(characterSpawn, channelPostingEventArgs.Type, channelPostingEventArgs.Text); Posted?.Invoke(this, channelPostedEventArgs); }
/// <summary> /// Called when [posted]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="ChannelPostedEventArgs" /> instance containing the event data.</param> private void OnPosted(object sender, ChannelPostedEventArgs e) { _muteConditionByCharacterSpawnId[e.CharacterSpawn.Id].Restart(); }