Team Fortress 2 Source Code as on 22/4/2020
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.

56 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef CHANGEFRAMELIST_H
  8. #define CHANGEFRAMELIST_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "bitbuf.h"
  13. // This class holds the last tick (from host_tickcount) that each property in
  14. // a datatable changed at.
  15. //
  16. // It provides fast access to a list of properties that changed within a certain frame range.
  17. //
  18. // These are created once per entity per frame. Since usually a very small percentage of an
  19. // entity's properties actually change each frame, this allows you to get a small set of
  20. // properties to delta for each client.
  21. abstract_class IChangeFrameList
  22. {
  23. public:
  24. // Call this to delete the object.
  25. virtual void Release() = 0;
  26. // This just returns the value you passed into AllocChangeFrameList().
  27. virtual int GetNumProps() = 0;
  28. // Sets the change frames for the specified properties to iFrame.
  29. virtual void SetChangeTick( const int *pPropIndices, int nPropIndices, const int iTick ) = 0;
  30. // Get a list of all properties with a change frame > iFrame.
  31. virtual int GetPropsChangedAfterTick( int iTick, int *iOutProps, int nMaxOutProps ) = 0;
  32. virtual IChangeFrameList* Copy() = 0; // return a copy of itself
  33. protected:
  34. // Use Release to delete these.
  35. virtual ~IChangeFrameList() {}
  36. };
  37. // Call to initialize. Pass in the number of properties this CChangeFrameList will hold.
  38. // All properties will be initialized to iCurFrame.
  39. IChangeFrameList* AllocChangeFrameList( int nProperties, int iCurFrame );
  40. #endif // CHANGEFRAMELIST_H