.


:




:

































 

 

 

 


. -. .




( , ) - .

"-". (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 , , .

 

 





:


: 2016-07-29; !; : 675 |


:

:

, , .
==> ...

1570 - | 1474 -


© 2015-2024 lektsii.org - -

: 0.013 .