public HostSayEventArgs(HMessage packet) { _packet = packet; Header = _packet.Header; Message = _packet.ReadString(0); Theme = (HTheme)_packet.ReadInt(_packet.Length - 10); }
/// <summary> /// Returns the primitive value for the specified <see cref="HTheme"/>. /// </summary> /// <param name="theme">The <see cref="HTheme"/> you wish to retrieve the primitive value from.</param> /// <returns></returns> public static int Juice(this HTheme theme) { if (theme != HTheme.Random) { return((int)theme); } lock (_randomThemeLock) return(_randomTheme.Next(0, 30)); }
public PlayerWhisperEventArgs(HMessage packet) { _packet = packet; Header = _packet.Header; int position = 0; PlayerIndex = _packet.ReadInt(ref position); Message = _packet.ReadString(ref position); _packet.ReadInt(ref position); Theme = (HTheme)_packet.ReadInt(ref position); }
/// <summary> /// Returns the primitive value for the specified <see cref="HTheme"/>. /// </summary> /// <param name="theme">The <see cref="HTheme"/> you wish to retrieve the primitive value from.</param> /// <returns></returns> public static int Juice(this HTheme theme) { if (theme != HTheme.Random) { return((int)theme); } int randomIndex = _randomThemeGen.Next(0, _randomThemes.Length - 1); return((int)_randomThemes .GetValue(randomIndex)); }