We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
Nested classes? (Read 863 times)
Nested classes?
May 8th, 2005, 10:55am
 
Maybe not strictly a syntax question, but this seemed like the best place..

My problem is this; in some older sketches I have set up a series of classes that are kind of nested- e.g creating an instance of the 'outer' class (colony) which in turn creates as  part of its variables an array of instances of the 'inner' class (termites)- at the time this seemed a good way of structuring things. However this means termites can only call methods of other termites by going through the specific instance name of the outer class; this was OK before but does not scale well.

Can anyone suggest a solution that will allow multiple 'outer' classes or colonies without breaking things?

Cheers,
Samuel
Page Index Toggle Pages: 1