Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 42225

How can I move an item from a collection to another collection: 2 questions

$
0
0
I have 2 collections that hold the same kind of object. One is an inventory and the other is a list of available items. If the user takes an item, I would like to move the item from the available items to the inventory. I don't want to copy it, I want to move it. How can I do this? Here is a code snippet of how it's setup, but no actual code to do anything, since that's what I'm working on.

Code:

Public Items as New List(Of Item)
Public Inventory as New List(Of Item)

I have 2 questions however. The Item objects have an ID member. How can I search for the item by the ID member once it is in one of the collections?

Viewing all articles
Browse latest Browse all 42225

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>