source-engine/game/server/tf2/tf_func_weldable_door.h

82 lines
1.9 KiB
C
Raw Normal View History

2020-04-22 16:56:21 +00:00
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef TF_FUNC_WELDABLE_DOOR_H
#define TF_FUNC_WELDABLE_DOOR_H
#ifdef _WIN32
#pragma once
#endif
#include "doors.h"
class CBeam;
//-----------------------------------------------------------------------------
// Purpose: Weld Point for a weldable door
//-----------------------------------------------------------------------------
class CWeldPoint : public CPointEntity
{
DECLARE_CLASS( CWeldPoint, CPointEntity );
public:
void Spawn( void );
void SetEndPoint( const Vector &vecEndPoint );
const Vector &GetStartPoint( void ) const;
const Vector &GetEndPoint( void ) const;
private:
Vector m_vecEndPoint;
};
// Weld Leader
enum
{
WL_UNASSIGNED,
WL_WELD_LEADER,
WL_WELD_CHILD,
};
//-----------------------------------------------------------------------------
// Purpose: A weldable door
//-----------------------------------------------------------------------------
class CWeldableDoor : public CBaseDoor
{
public:
DECLARE_CLASS( CWeldableDoor, CBaseDoor );
DECLARE_DATADESC();
virtual void Spawn( void );
virtual void Activate( void );
// Welding
virtual bool IsWeldable( CBaseTFPlayer *pWeldee );
virtual void StartWelding( CBaseTFPlayer *pWeldee );
virtual void StopWelding( void );
virtual float GetWeldPercentage( void );
virtual Vector GetPlayerWeldPoint( void );
virtual void UpdateWeld( bool bCutting, float flWeldPercentage );
CWeldableDoor *GetWeldLeader( void );
// Welding
int m_iWeldLeader;
EHANDLE m_hWeldingPlayer;
// Weld points
string_t m_iszWeldPoints;
CUtlVector < CWeldPoint * > m_aWeldPoints;
// Weld beams
float m_flMaxWeldedPercentage;
float m_flWeldedPercentage;
CUtlVector < CBeam * > m_aWeldBeams;
CUtlVector < CBeam * > m_aCutBeams;
};
#endif // TF_FUNC_WELDABLE_DOOR_H