Hello Jerry,
I think I have enough information to answer.
You have a dictionary, itemDictionary
with two inner-dictionaries. Key 0
has a dictionary describing shot_shell
, key 1
has a dictionary describing medbak
.
If you do itemDictionary = ...
you will replace the existing dictionary with a new one. And loose all of the existing keys.
To add a new item with the key 2
, you would do
itemDictionary[2] = {'itemName':'another_item', ...}
Here ...
is all of the other entries in the dictionary, itemEq
, itemIcon
etc...
Maybe better would be an array?
var itemArray = []
itemArray.append( {'itemName':'shot_shell', ...} )
itemArray.append( {'itemName':'medbak', ...} )
itemArray.append( {'itemName':'another_item', ...} )
...
Having either a dictionary with integer keys, or an array, will make deleting ranges easier than if the dictionary keys were strings.
To remove 10-15 for an integer-key dictionary
for i in range(10, 15):
itemDictionary.erase(i)
To remove 10-15 for an array
for i in range(10, 15):
itemArray.remove(i)