8.2. Overview of the critter class fields
Our critters will have a large number of primitive fields relating to their internal state, to the game they participate in, and to their motion. These primitive fields will mostly be int, Real, or cVector objects. Recall that Real is a type we typedef in realnumber.h to be float, although it could be changed to double.
Mixed in with the primitives, our cCritter objects will have pointer fields that hold references to a few other classes. The best way to get a quick idea of the class members is to look at the full cCritter prototype listing in the last section of this chapter.
In brief, the cCritter fields fall into these groupings.
State fields, such as the Real _age and int _health.
Game fields, such ...
Get Software Engineering and Computer Games now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.