( , ) - .
"-". (Engine) (Car):
, . , std::string m_model , Car, , - -, - -.
- . , . . , , - , .
. . . , .
.
. , -. . - , .
, , , , . , , .
(Weapon) , (WeaponType). Weapon WeaponType , . , . .
- . , . , , . - .
|
|
, (Helicopter). . . ( Weapon). , , .
, . , . nullptr.
Helicopter Weapon . installWeapon, deinstallWeapon. - , , , . , .
.
( --) Car-Engine
(--) (HelicopterEscadrille-Helicopter).
(--) (HelicopterPilot-MilitaryMission).
23. std::vector . - -.
- (STL - Standard Template Library). STL-, , , . , ++ .
, , std::vector, :
● size - ;
● empty - ;
● clear - ;
● push_back -
● pop_back - ;
● [] - ;
● at - ;
● insert - ( );
● erase - ( )
. , , .
, - - :
|
|
● ;
● , , , ;
● , std::vector , "" ;
● .
- - . - .
-, , , , - . . , . , - . (nullptr).
, -. ( ), .
, , :
● - , .. , , getMaxUnitsCount, ;
● , findFreeUnitPosition;
● getHelicopter - , ;
● , ;
● getJoinedUnitsCount ;
● ;
● erase , , .