You will not find the actual code of these classes but only declarations
of all members. This is because these classes are internal WCM C++
classes. But good news is that you can inherit them!
For example we can find a declaration of character
and change his walking style!
The class hierarchy starts with the
class and incudes other classes class derived from
. You probably noted a first capital letter "I" in the names of these
classes. We added these letters to indicate that these are "interface"
(or abstract) classes. These classes are incomplete. They have some
useful methods to register and work with characters; some of them have
common parts declared but none of them have actual pictures assigned
with parts. To make these classes useful you need to derive a new
class, such as
Looking into character
declaration you will find out that it is derived from
is, in turn, derived from the class
has a method
. (Please do not pay too much attention to word
virtual, it just indicates that this method is being defined in an
, a fact that is not particularly important for creating WCM cartoons.
Note: If you are interested in general C++ programming, you should study
this concept as explained in a general C++ reference book or web site.
takes 3 mandatory parameters and one optional parameter with default
are the target coordinates.
is the duration of walking in seconds.
is the duration of one step in seconds. This method will be changed in
the next section.
The full class hierarchy
for Boy is:
Quite a list of “parents,” each of which, through
provides additional functionality for the Boy class, which, unlike its
parents, can actually be implemented, i.e. it can be used for actual
WCM characters. We will illustrate the implementation of a new
implementable class in a following section. For now, let’s look at
modifying the Boy class.