Beispiel #1
0
        public HostSayEventArgs(HMessage packet)
        {
            _packet = packet;
            Header  = _packet.Header;

            Message = _packet.ReadString(0);
            Theme   = (HTheme)_packet.ReadInt(_packet.Length - 10);
        }
Beispiel #2
0
        /// <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));
        }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        /// <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));
        }