ID:952590
 
(See the best response by Kaiochao.)
Problem description: Let's say i have lot of objects on the client screen, how do identify them so i can easily delete them later?

(I need to do efficient way, that's why i ask.)
Best response
One way I like to do when dealing with client.screen, client.images, and atom.overlays is to keep track of what I'm adding to them as I add to them. This can be done by making a secondary list and adding to both so later you can subtract the secondary list from the primary list.
In response to Kaiochao
Kaiochao wrote:
One way I like to do when dealing with client.screen, client.images, and atom.overlays is to keep track of what I'm adding to them as I add to them. This can be done by making a secondary list and adding to both so later you can subtract the secondary list from the primary list.

Could you explain it a little better? :x
In response to Blastcore
var/list/addedobjs=new()

var/obj/o = new
client.screen+=o
addedobjs+=o
In response to NNAAAAHH
NNAAAAHH wrote:
var/list/addedobjs=new()
>
> var/obj/o = new
> client.screen+=o
> addedobjs+=o


Yes, that's simple. But let's think if i have the same object multiple times on the client screen.
Also client.screen is a list, so i think it should output the objects it does have.
You could give screen objs a value variable and then use some logical system of labeling them that you can later easily compare and only remove the objs with that value.