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.

50 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. #ifndef INPUTVAR_H
  9. #define INPUTVAR_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "baseentity.h"
  14. #include "entitylist.h"
  15. //-----------------------------------------------------------------------------
  16. // Purpose: Used to request a value, or a set of values, from a set of entities.
  17. // used when a multi-input variable needs to refresh it's inputs
  18. //-----------------------------------------------------------------------------
  19. class CMultiInputVar
  20. {
  21. public:
  22. CMultiInputVar() : m_InputList(NULL) {}
  23. ~CMultiInputVar();
  24. struct inputitem_t
  25. {
  26. variant_t value; // local copy of variable (maybe make this a variant?)
  27. int outputID; // the ID number of the output that sent this
  28. inputitem_t *next;
  29. // allocate and free from MPool memory
  30. static void *operator new( size_t stAllocBlock );
  31. static void *operator new( size_t stAllocateBlock, int nBlockUse, const char *pFileName, int nLine );
  32. static void operator delete( void *pMem );
  33. static void operator delete( void *pMem, int nBlockUse, const char *pFileName, int nLine ) { operator delete(pMem); }
  34. };
  35. inputitem_t *m_InputList; // list of data
  36. int m_bUpdatedThisFrame;
  37. void AddValue( variant_t newVal, int outputID );
  38. DECLARE_SIMPLE_DATADESC();
  39. };
  40. #endif // INPUTVAR_H