Hi,
Are you planning to add some kind of lightweight “RTTI” support? My point is that it would be nice to for example set opacity on all child nodes which supports CCRGBAProtocol. This is not possible since there is no way to save cast CCNode to anything higher. I think that some kind of numbers or enums would be enough.
There must be better way but something like:
enum ObjectType { otTransportation, otBus }
class Transport
{
virtual bool implements(ObjectType type) { return type == otTransportation; }
}
class Bus : public Transport
{
virtual bool implements(ObjectType type) { return type == otBus || Transport::implements(type); }
}
There is huge problem with this solution and it is ObjectType enum definition and it’s extending SDK vs. Developer. But when you use numbers and assure that there will be some boundaries reserved for SDK and for developers to avoid its mixture it should work.
What is your opinion?