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.

63 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Interface of CLogEventArgument
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. //
  8. //------------------------------------------------------------------------------------------------------
  9. // $Log: $
  10. //
  11. // $NoKeywords: $
  12. //=============================================================================//
  13. #ifndef ARGUMENT_H
  14. #define ARGUMENT_H
  15. #ifdef WIN32
  16. #pragma once
  17. #endif
  18. #include "pid.h"
  19. #include <vector>
  20. #include <string>
  21. //------------------------------------------------------------------------------------------------------
  22. // Purpose: CLogEventArgument represents a variable in the text of an event.
  23. // for example, "X" killed "Y" with "Z". X Y and Z are all represented by seperate
  24. // instances of this class.
  25. //------------------------------------------------------------------------------------------------------
  26. class CLogEventArgument
  27. {
  28. public:
  29. enum
  30. {
  31. INVALID_PID=-1,
  32. INVALID_WONID=0,
  33. VALUE_WID=64,
  34. PLAYER_NAME_WID=VALUE_WID,
  35. WONID_WID=(10+6), //<WON:xxxxxxxxxx>
  36. PLAYERID_WID=4 // <xx> //only up to 99 players :(
  37. };
  38. private:
  39. char* m_ArgText;
  40. bool m_Valid;
  41. public:
  42. explicit CLogEventArgument(const char* text);
  43. CLogEventArgument();
  44. void init(const char* text);
  45. //int asPlayerGetID() const;
  46. int asPlayerGetSvrPID() const;
  47. unsigned long asPlayerGetWONID() const;
  48. PID asPlayerGetPID() const;
  49. char* asPlayerGetName(char* copybuf) const;
  50. std::string asPlayerGetName() const;
  51. double getFloatValue() const;
  52. const char* getStringValue() const;
  53. char* getStringValue(char* copybuf) const;
  54. bool isValid() const {return m_Valid;}
  55. };
  56. typedef std::vector<CLogEventArgument*> ArgVector;
  57. #endif // ARGUMENT_H