public void ResetChain(MessageChainData chain) { if (chain == null) return; ResetChain(chain, chain.Message); }
public void ResetChain(MessageChainData chain) { if (chain == null) { return; } ResetChain(chain, chain.Message); }
private bool ShouldParticipateInChain(MessageChainData currentChain) { var baseChance = Double.Parse(Config.Get("MessageChainBaseChance", "0.125")); var multiplier = Double.Parse(Config.Get("MessageChainChanceMultiplier", "2")); var chanceOfParticipating = 0.0; if (currentChain.Length > 1) { chanceOfParticipating = baseChance * Math.Pow(multiplier, currentChain.Length-2); } return StaticRandom.NextDouble() < chanceOfParticipating; }
private bool ShouldParticipateInChain(MessageChainData currentChain) { var baseChance = Double.Parse(Config.Get("MessageChainBaseChance", "0.125")); var multiplier = Double.Parse(Config.Get("MessageChainChanceMultiplier", "2")); var chanceOfParticipating = 0.0; if (currentChain.Length > 1) { chanceOfParticipating = baseChance * Math.Pow(multiplier, currentChain.Length - 2); } return(StaticRandom.NextDouble() < chanceOfParticipating); }
public void AddMessage(string channel, string message) { MessageChainData currentChain; if (!chains.TryGetValue(channel, out currentChain)) { currentChain = new MessageChainData() { Message = message, Length = 0 }; chains[channel] = currentChain; } if (currentChain.Message.Equals(message, StringComparison.InvariantCultureIgnoreCase)) { currentChain.Length++; } else { ResetChain(currentChain, message); } }
public void AddMessage(string channel, string message) { MessageChainData currentChain; if (!chains.TryGetValue(channel, out currentChain)) { currentChain = new MessageChainData() { Message = message, Length = 0 }; chains[channel] = currentChain; } if (currentChain.Message.Equals(message, StringComparison.InvariantCultureIgnoreCase)) { currentChain.Length++; } else { ResetChain(currentChain, message); } }
private void ResetChain(MessageChainData chain, string newMessage) { chain.Message = newMessage; chain.Length = 0; }
private void ResetChain(MessageChainData chain, string newMessage) { chain.Message = newMessage; chain.Length = 0; }