> Comment #2 on issue 74 by [email protected]: add with name, remove with
> reference, add gain with name 
> failsttp://code.google.com/p/los-cocos/issues/detail?id=74
>
> I'd also like to see this change so that adding by name and then removing by
> object works. I can submit a patch with tests if you will allow it. One
> could solve it by
> (1) adding a 'name' field to a cocos_node,
first look: easy and should do the work

second look: what if user changes the name ? -> 'name' should be a
property, either Read Only or with a setter that adjust the name ->
obj dictionary

third look: it is an interface change, and could broke user code using
the attribute 'name' in their code

> (2) adding a dictionary of {node : object}
a dict of  cocosnode instance: name ?

An instance of CocosNode base class can be used as a dictionary key,
but, is that true for any subclass ?

> (3) search through children_names to find the name and object. I can do it 
> any way you prefer.
while slower, I don't see any side effect or hidden requirements
added.

I personally prefer the third one.

Anyone (developers or users) have another take on the issue ?

--
claudio


-- 
You received this message because you are subscribed to the Google Groups 
"cocos2d discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cocos-discuss?hl=en.

Reply via email to