void Car addEngine Engine engine mEngine engine addPart engine br void

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
void Car::addEngine(Engine* engine)
{
mEngine = engine;
addPart(engine);
}
<br/>
void EngineLada::init()
{
mSparkPlugs = new SparkPlug[4];
addPart(&mSparkPlugs[0]);
addPart(&mSparkPlugs[1]);
addPart(&mSparkPlugs[2]);
addPart(&mSparkPlugs[3]);
...
}