- Joined
- Apr 19, 2011
- Messages
- 1,331
I currently want to take a value from an hashtable and put it somewhere else in my hashtable.
So, yeah, you would say that's easy just use Save <VariableType> in Hashtable. But i want to move my value regardless of it's type, and this value could be of any type.
A solution would be to test if the value is from X type and if yes, then move it using action Save X in hashtable. But well, this would just suck and might even lag since this would be put in a loop that might repeat itself thousand times in a normal game situation and this every 0.03 seconds.
I heard that we can save several datas at the same place in an hashtable aslong as they are from different types. And so, if there's a way of moving the value if it's an handle regardless of it being an unit's handle, an object handle or whatever's handle, it would solve the problem. So, yeah kinda a Save Handle in Hashtable instead of the Save Something's Handle in Hashtable.
So, two questions :
- Is it possible to put two different values in the same place on an hashtable if they're not from the same type, i.e. save both an Integer and a String at the same place in the hashtable ?
- If yes, is there a function to save an handle (from any type of handle) in an hashtable ?
So, yeah, you would say that's easy just use Save <VariableType> in Hashtable. But i want to move my value regardless of it's type, and this value could be of any type.
A solution would be to test if the value is from X type and if yes, then move it using action Save X in hashtable. But well, this would just suck and might even lag since this would be put in a loop that might repeat itself thousand times in a normal game situation and this every 0.03 seconds.
I heard that we can save several datas at the same place in an hashtable aslong as they are from different types. And so, if there's a way of moving the value if it's an handle regardless of it being an unit's handle, an object handle or whatever's handle, it would solve the problem. So, yeah kinda a Save Handle in Hashtable instead of the Save Something's Handle in Hashtable.
So, two questions :
- Is it possible to put two different values in the same place on an hashtable if they're not from the same type, i.e. save both an Integer and a String at the same place in the hashtable ?
- If yes, is there a function to save an handle (from any type of handle) in an hashtable ?