//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose: // // $NoKeywords: $ //===========================================================================// // Navigation ladders // Author: Michael S. Booth (mike@turtlerockstudios.com), January 2003 #ifndef _NAV_LADDER_H_ #define _NAV_LADDER_H_ #include "nav.h" class CNavArea; //-------------------------------------------------------------------------------------------------------------- /** * The NavLadder represents ladders in the Navigation Mesh, and their connections to adjacent NavAreas * @todo Deal with ladders that allow jumping off to areas in the middle */ class CNavLadder { public: CNavLadder( void ) { m_topForwardArea = NULL; m_topRightArea = NULL; m_topLeftArea = NULL; m_topBehindArea = NULL; m_bottomArea = NULL; // set an ID for interactive editing - loads will overwrite this m_id = m_nextID++; } ~CNavLadder(); void OnRoundRestart( void ); ///< invoked when a game round restarts void Save( CUtlBuffer &fileBuffer, unsigned int version ) const; void Load( CUtlBuffer &fileBuffer, unsigned int version ); unsigned int GetID( void ) const { return m_id; } ///< return this ladder's unique ID static void CompressIDs( void ); /// NavLadderVector; //-------------------------------------------------------------------------------------------------------------- inline bool CNavLadder::IsUsableByTeam( int teamNumber ) const { if ( m_ladderEntity.Get() == NULL ) return true; int ladderTeamNumber = m_ladderEntity->GetTeamNumber(); return ( teamNumber == ladderTeamNumber || ladderTeamNumber == TEAM_UNASSIGNED ); } //-------------------------------------------------------------------------------------------------------------- inline CBaseEntity *CNavLadder::GetLadderEntity( void ) const { return m_ladderEntity.Get(); } //-------------------------------------------------------------------------------------------------------------- inline NavDirType CNavLadder::GetDir( void ) const { return m_dir; } //-------------------------------------------------------------------------------------------------------------- inline const Vector &CNavLadder::GetNormal( void ) const { return m_normal; } #endif // _NAV_LADDER_H_