Re: question about the check sheet


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by John Kugelman on April 25, 2001 at 03:48:15:

In Reply to: question about the check sheet posted by meme on April 24, 2001 at 21:49:01:

meme wrote:

I am not sure I quiet understand what it means by : creature provides type informtion via a public member functions... does this mean we shouldn't have GetType() function in our classes? if not, how else are we supposed to provide the type information?

Notice the emphasis I've added. If you have such a function it should be protected or private to guarantee that it can never be called from outside the inheritance hierarchy. That way the ecosystem/manager objects can't "intercept" the function return value and determine the creature type. See the footnote; if you made it public, but can prove that it was never intercepted in this way, then it's only a 5 point deduction.




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]