Counter Strike : Global Offensive Source Code
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.

49 lines
2.0 KiB

  1. //========= Copyright � 1996-2003, Valve LLC, All rights reserved. ============
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef ITEM_CREATION_H
  7. #define ITEM_CREATION_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "igamesystem.h"
  12. #include "econ_item_system.h"
  13. #include "econ_entity.h"
  14. #if defined(TF_CLIENT_DLL) || defined(TF_DLL)
  15. #include "tf_shareddefs.h"
  16. #endif
  17. //-----------------------------------------------------------------------------
  18. // Purpose: Game system that handles initializing the item system, and generating items as full game entities
  19. //-----------------------------------------------------------------------------
  20. class CItemGeneration : public CAutoGameSystem
  21. {
  22. public:
  23. CItemGeneration( void );
  24. // Generate a random item matching the specified criteria
  25. CBaseEntity *GenerateRandomItem( CItemSelectionCriteria *pCriteria, const Vector &vecOrigin, const QAngle &vecAngles );
  26. // Generate a random item matching the specified definition index
  27. CBaseEntity *GenerateItemFromDefIndex( int iDefIndex, const Vector &vecOrigin, const QAngle &vecAngles );
  28. // Generate an item from the specified item data
  29. CBaseEntity *GenerateItemFromScriptData( CEconItemView *pData, const Vector &vecOrigin, const QAngle &vecAngles, const char *pszOverrideClassName );
  30. // Generate the base item for a class's loadout slot
  31. CBaseEntity *GenerateBaseItem( struct baseitemcriteria_t *pCriteria );
  32. private:
  33. // Create a new instance of the chosen item
  34. CBaseEntity *SpawnItem( int iChosenItem, const Vector &vecAbsOrigin, const QAngle &vecAbsAngles, int iItemLevel, entityquality_t entityQuality, const char *pszOverrideClassName );
  35. CBaseEntity *SpawnItem( CEconItemView *pData, const Vector &vecAbsOrigin, const QAngle &vecAbsAngles, const char *pszOverrideClassName );
  36. CBaseEntity *PostSpawnItem( CBaseEntity *pItem, IHasAttributes *pItemInterface, const Vector &vecAbsOrigin, const QAngle &vecAbsAngles );
  37. };
  38. extern CItemGeneration *ItemGeneration( void );
  39. #endif // ITEM_CREATION_H