コード例 #1
0
        public HostSayEventArgs(HMessage packet)
        {
            _packet = packet;
            Header  = _packet.Header;

            Message = _packet.ReadString(0);
            Theme   = (HTheme)_packet.ReadInt(_packet.Length - 10);
        }
コード例 #2
0
ファイル: SKore.cs プロジェクト: jychan98/Sulakore
        /// <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));
        }
コード例 #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);
        }
コード例 #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));
        }