You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.2 KiB
65 lines
2.2 KiB
//========= Copyright Valve Corporation, All rights reserved. ============// |
|
// |
|
// Purpose: Auto Repair |
|
// |
|
// $NoKeywords: $ |
|
//=============================================================================// |
|
#include "cbase.h" |
|
#include "c_tf_class_commando.h" |
|
#include "c_tf_class_defender.h" |
|
#include "c_tf_class_escort.h" |
|
#include "c_tf_class_infiltrator.h" |
|
#include "c_tf_class_medic.h" |
|
#include "c_tf_class_recon.h" |
|
#include "c_tf_class_sniper.h" |
|
#include "c_tf_class_support.h" |
|
#include "c_tf_class_sapper.h" |
|
|
|
//----------------------------------------------------------------------------- |
|
// Purpose: |
|
//----------------------------------------------------------------------------- |
|
C_PlayerClass::C_PlayerClass( C_BaseTFPlayer *pPlayer ) |
|
{ |
|
// Save peer. |
|
m_pPlayer = pPlayer; |
|
} |
|
|
|
//----------------------------------------------------------------------------- |
|
// Purpose: |
|
//----------------------------------------------------------------------------- |
|
C_PlayerClass::~C_PlayerClass() |
|
{ |
|
} |
|
|
|
|
|
//----------------------------------------------------------------------------- |
|
// Purpose: |
|
//----------------------------------------------------------------------------- |
|
C_PlayerClass *C_PlayerClass::Create( C_BaseTFPlayer *pPlayer, int iClassType ) |
|
{ |
|
// Create the class type |
|
switch ( iClassType ) |
|
{ |
|
case TFCLASS_COMMANDO: { return ( new C_PlayerClassCommando( pPlayer ) ); } |
|
case TFCLASS_DEFENDER: { return ( new C_PlayerClassDefender( pPlayer ) ); } |
|
case TFCLASS_ESCORT: { return ( new C_PlayerClassEscort( pPlayer ) ); } |
|
case TFCLASS_INFILTRATOR: { return ( new C_PlayerClassInfiltrator( pPlayer ) ); } |
|
case TFCLASS_MEDIC: { return ( new C_PlayerClassMedic( pPlayer ) ); } |
|
case TFCLASS_RECON: { return ( new C_PlayerClassRecon( pPlayer ) ); } |
|
case TFCLASS_SNIPER: { return ( new C_PlayerClassSniper( pPlayer ) ); } |
|
case TFCLASS_SUPPORT: { return ( new C_PlayerClassSupport( pPlayer ) ); } |
|
case TFCLASS_SAPPER: { return ( new C_PlayerClassSapper( pPlayer ) ); } |
|
default: { return NULL; } |
|
} |
|
} |
|
|
|
//----------------------------------------------------------------------------- |
|
// Purpose: |
|
//----------------------------------------------------------------------------- |
|
void C_PlayerClass::Destroy( C_PlayerClass *pPlayerClass ) |
|
{ |
|
if ( pPlayerClass ) |
|
{ |
|
delete pPlayerClass; |
|
} |
|
}
|
|
|