示例#1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="UserItem" /> class.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="baseItemId">The base item identifier.</param>
        /// <param name="extraData">The extra data.</param>
        /// <param name="group">The group.</param>
        /// <param name="songCode">The song code.</param>
        internal UserItem(uint id, uint baseItemId, string extraData, uint group, string songCode)
        {
            Id = id;
            BaseItemId = baseItemId;
            ExtraData = extraData;
            GroupId = group;
            BaseItem = Azure.GetGame().GetItemManager().GetItem(baseItemId);

            if (BaseItem == null)
                return;

            using (var queryReactor = Azure.GetDatabaseManager().GetQueryReactor())
            {
                queryReactor.SetQuery($"SELECT * FROM items_limited WHERE item_id={id} LIMIT 1");
                var row = queryReactor.GetRow();

                if (row != null)
                {
                    uint.TryParse(row[1].ToString(), out LimitedSellId);
                    uint.TryParse(row[2].ToString(), out LimitedStack);
                }
            }

            IsWallItem = (BaseItem.Type == 'i');
            SongCode = songCode;
        }
示例#2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="SongItem" /> class.
 /// </summary>
 /// <param name="item">The item.</param>
 public SongItem(UserItem item)
 {
     ItemId = item.Id;
     SongId = SoundMachineSongManager.GetSongId(item.SongCode);
     BaseItem = item.BaseItem;
     ExtraData = item.ExtraData;
     SongCode = item.SongCode;
 }
示例#3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="SongItem" /> class.
        /// </summary>
        /// <param name="itemId">The item identifier.</param>
        /// <param name="songId">The song identifier.</param>
        /// <param name="baseItem">The base item.</param>
        /// <param name="extraData">The extra data.</param>
        /// <param name="songCode">The song code.</param>
        public SongItem(uint itemId, uint songId, int baseItem, string extraData, string songCode)
        {
            ItemId = itemId;
            SongId = songId;

            BaseItem = Azure.GetGame().GetItemManager().GetItem(((uint) baseItem));

            ExtraData = extraData;
            SongCode = songCode;
        }