//----------------------------------------------------------------------------- // Copyright(c), HL Rally: Source, 2004, All rights reserved. // The contents of this file may only be used / distributed in accordance // with the conditions listed in the supplied license, or with written // permission of the respective authors listed. //----------------------------------------------------------------------------- #ifndef CHECKPOINTMANAGERABC_H #define CHECKPOINTMANAGERABC_H #include "../game_shared/hlrally2/SingletonABC.h" // Forward references class CEntityInfoCheckpoint; class CPlayerRally; /** * Description: * * Controller class that contains methods that handles checkpoint triggered events. * Contains collection of pointers checkpoint entities. * Has methods which return pointers to checkpoints. * Singleton abstract base class **/ class CCheckpointManagerABC : private CSingletonABC { public: // Private constructor / destructor to enforce singleton CCheckpointManagerABC(); virtual ~CCheckpointManagerABC(); void ResetAllCheckpoints(); CEntityInfoCheckpoint *GetCheckpointFirst(); CEntityInfoCheckpoint *GetCheckpointLast(); CEntityInfoCheckpoint *GetCheckpointAtTouchOrder(int iTouchOrder); CEntityInfoCheckpoint *GetCheckpointBeforeTouchOrder(int iTouchOrder); CEntityInfoCheckpoint *GetCheckpointAfterTouchOrder(int iTouchOrder); static void SetInstance(CCheckpointManagerABC *pCheckpointManager) { FreeInstance(); ms_pInstance = pCheckpointManager; } static CCheckpointManagerABC *GetInstance() { return CSingletonABC::GetInstance(); } static void FreeInstance() { CSingletonABC::FreeInstance(); } /** * Description: * Invoked when any player touches any checkpoint, and it is the correct checkpoint. * * @param pCheckpoint Pointer to the checkpoint entity touched by pPlayer * @param pPlayer Pointer to the player that touched pCheckpoint **/ virtual void CheckpointTouchCorrect(CEntityInfoCheckpoint *pCheckpoint, CPlayerRally *pPlayer); /** * Description: * Invoked when any player touches any checkpoint, and it is a checkpoint out of order. * * @param pCheckpoint Pointer to the checkpoint entity touched by pPlayer * @param pPlayer Pointer to the player that touched pCheckpoint **/ virtual void CheckpointTouchWrong(CEntityInfoCheckpoint *pCheckpoint, CPlayerRally *pPlayer); virtual void CheckpointTouchFirstPlayerThrough(CEntityInfoCheckpoint *pCheckpoint, CPlayerRally *pPlayer); virtual void CheckpointTouchLastPlayerThrough(CEntityInfoCheckpoint *pCheckpoint, CPlayerRally *pPlayer); virtual void CheckpointPlayerFinishesLap(CPlayerRally *pPlayer); virtual void CheckpointPlayerFinishesRace(CPlayerRally *pPlayer); }; #endif