예제 #1
0
파일: UserItem.cs 프로젝트: weslley17w/Yupi
        /// <summary>
        ///     Initializes a new instance of the <see cref="UserItem" /> class.
        /// </summary>
        /// <param name="id">The identifier.</param>
        /// <param name="baseName">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, string baseName, string extraData, uint group, string songCode)
        {
            Id = id;
            ExtraData = extraData;
            GroupId = group;

            BaseItem = Yupi.GetGame().GetItemManager().GetItemByName(baseName);

            if (BaseItem == null)
                return;

            using (IQueryAdapter commitableQueryReactor = Yupi.GetDatabaseManager().GetQueryReactor())
            {
                commitableQueryReactor.SetQuery($"SELECT * FROM items_limited WHERE item_id={id} LIMIT 1");
                DataRow row = commitableQueryReactor.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
파일: SongItem.cs 프로젝트: weslley17w/Yupi
 /// <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
파일: SongItem.cs 프로젝트: weslley17w/Yupi
        /// <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="baseName">The base item.</param>
        /// <param name="extraData">The extra data.</param>
        /// <param name="songCode">The song code.</param>
        public SongItem(uint itemId, uint songId, string baseName, string extraData, string songCode)
        {
            ItemId = itemId;
            SongId = songId;

            BaseItem = Yupi.GetGame().GetItemManager().GetItemByName(baseName);

            ExtraData = extraData;
            SongCode = songCode;
        }