|
|
|
DESCRIPTION:
|
This is the CSmiley Object class. It will INHERIT all the properties and
methods from the CSprite class, thus CSprite.asm must be included into the project.
CSmiley will then extend this basis by providing extra methods to work
on the inherited properties, they are enableSteps() and setStepsDC(). As well
since new features are added to the base class (via inheritance), this class will
also provide a "polymorphic" draw method. This means that when a CSmiley object is
told to do its "draw" method, this new method function will be called upon, however,
if a CSprite class is called to do its "draw" method, the origional "draw" will be
called upon (This is the essence of Polymorphism).
|
|
|
METHOD:
|
CONSTRUCTOR (NONE)
|
|
DESCRIPTION:
|
Basic constructor setup as well as inheriting from CSprite and providing
polymorphism for the "draw" method. As well the constructor will set each
instance up with a DC to hold footprints and load the graphic into it.
This is the basic purpose demostrated by inheriting the base CSprite class
and appending extra freatures to it (foot prints in this case).
|
|
|
|
METHOD:
|
destructor (NONE)
|
|
DESCRIPTION:
|
Will delete the object extra footprint bitmap and the extra DC created for
this object. As well it will then call the SUPER class (CSprite) which this
class is inherited from and call its DESTRUCTOR method to do all the extra
clean up it provides for its base properties.
|
|
|
|
|
DESCRIPTION:
|
This is the polymorphic draw method specific to CSmiley object instnaces.
It re-uses the inherited "draw" code form the base class it inherits from (CSprite),
and then does some "extra" functionality to draw footprints as well, provided
that that Steps has been enabled for the CSmiley objects instance.
|
|
|
|
|
DESCRIPTION:
|
Used to set the DC for the footprint graphics for this object.
|
|
|
hDC
|
The DC the footprint graphics are to be saved to.
|
|
|
|
METHOD:
|
enableSteps (flag)
|
|
DESCRIPTION:
|
Used to set each instance to show or not show footprints when drawn with
the polymorphic draw method (by calling draw upon a CSmiley class instance).
|
|
|
flag
|
True, the footprints are drawn, FLASE, they are not.
|
|
|
|