Example #1
0
        //保证当前容量能容纳添加数量,否则不会添加
        public override void AddUserItem(UserItem userItem)
        {
            VolumeUserItem volume = GetVolumeUserItem(GetVolumeKey(userItem.id));

            if (volume.GetLeaveNum(userItem) >= 0)
            {
                volume.AddUserItem(userItem);
                base.AddUserItem(userItem);
            }
        }
Example #2
0
        //保证当前格能容纳添加数量,否则不会添加
        public void AddUserItem(int pos, UserItem userItem)
        {
            VolumeUserItem volume = GetVolumeUserItem(GetVolumeKey(userItem.id));

            if (volume.GetLeaveNum(pos, userItem) >= 0)
            {
                volume.AddUserItem(pos, userItem);
                base.AddUserItem(userItem);
            }
        }
Example #3
0
        public int GetLeaveNum(int pos, UserItem userItem)
        {
            VolumeUserItem volume = GetVolumeUserItem(GetVolumeKey(userItem.id));

            return(volume.GetLeaveNum(pos, userItem));
        }