Moving values between arrays
Posted: 04 Mar 2013, 02:43
I have several Lists. I want to keep PlayerLogins in one list at a time only. So when I add a PlayerLogin to one list(array) I want to remove it from all others.
just using List.remove gives "this value will be discarded" while compiling. Still seems to work but it interupts the compiling and I figure it might make the script really slow if it discards after several attempts to get and remove value.
So what I need some help with is to move a login from a list to a different while making sure that list is the only list that contain the login.
Example:
List A Superman,Hulk,Finn,Gir
List B Flash,Spiderman,Bender
List C Dr_Doom,Alex
Now I want to move Finn from list A to list B
So I add Finn to list B
Remove Finn from list A and C since I don't check if the list contains Finn and just want to make sure not to get duplicate.
Which is the best way to solve it?
just using List.remove gives "this value will be discarded" while compiling. Still seems to work but it interupts the compiling and I figure it might make the script really slow if it discards after several attempts to get and remove value.
So what I need some help with is to move a login from a list to a different while making sure that list is the only list that contain the login.
Example:
List A Superman,Hulk,Finn,Gir
List B Flash,Spiderman,Bender
List C Dr_Doom,Alex
Now I want to move Finn from list A to list B
So I add Finn to list B
Remove Finn from list A and C since I don't check if the list contains Finn and just want to make sure not to get duplicate.
Which is the best way to solve it?