Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Can I call a like-named custom method for all in a list of objects?
Old
thefoster
Guest
 
Status:
Posts: n/a
Default Can I call a like-named custom method for all in a list of objects? - 02-07-2010, 01:52 PM

I have a list of different objects (different fish objects).
For each fish object I have defined my own method (called 'swim' for each).

Is it possible to invoke all of the objects' 'swim' methods using the "for all together"?

When I grab the "item_from_list" reference I can only see the default methods.

Cheers.
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 02-07-2010, 10:30 PM

Unfortunately no.

You can have a general method with object parameters that tells the object (and like named subparts) to move in a certain way, then have one fish at a time do it, or you can have each fish do their own swim method in a normal doTogether method, but you can't combine the two.


(')>
   
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.