Posted by Daniel Longest on April 21, 2001 at 21:00:05:
In Reply to: "create" command, passing creature type to ecosystem posted by Naveed on April 21, 2001 at 20:01:09:
You can use explicit functions in the class (like add_browser, add_bush, etc). You could allocate an instance of the concrete class via newand pass that in. You could use the virtual constructor idiom. See http://www.parashift.com/cpp-faq-lite/
: Are we allowed to pass the type of a creature from the manager to the ecosystem when we create a creature? How else would the ecosystem know what kind of creature to create?
Post a Followup