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.

50 lines
1.7 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //===========================================================================//
  9. #ifndef IRESOURCEACCESSCONTROL_H
  10. #define IRESOURCEACCESSCONTROL_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. #include "tier0/dbg.h"
  15. #include "tier2/resourceprecacher.h"
  16. #include "appframework/iappsystem.h"
  17. //-----------------------------------------------------------------------------
  18. // Resource access control API
  19. //-----------------------------------------------------------------------------
  20. //-----------------------------------------------------------------------------
  21. // IResourceAccessControl
  22. // Purpose: Maintains lists of resources to use them as filters to prevent access
  23. // to ensure proper precache behavior in game code
  24. //-----------------------------------------------------------------------------
  25. abstract_class IResourceAccessControl : public IAppSystem
  26. {
  27. public:
  28. // Creates, destroys a resource list
  29. virtual ResourceList_t CreateResourceList( const char *pDebugName ) = 0;
  30. virtual void DestroyAllResourceLists( ) = 0;
  31. // Adds a resource to a resource list
  32. virtual void AddResource( ResourceList_t hResourceList, ResourceTypeOld_t nType, const char *pResourceName ) = 0;
  33. // Prevents access to anything except the specified resource list
  34. // Pass RESOURCE_LIST_INVALID to allow access to all resources
  35. virtual void LimitAccess( ResourceList_t hResourceList ) = 0;
  36. // Is access to this resource allowed?
  37. virtual bool IsAccessAllowed( ResourceTypeOld_t nType, const char *pResource ) = 0;
  38. };
  39. #endif // IRESOURCEACCESSCONTROL_H