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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access