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.

45 lines
1.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: provides an interface for plugins to query information about the gamerules in a simple
  4. // and organized mannor.
  5. //
  6. //===============================================================================================//
  7. #ifndef IGAMEINFO_H
  8. #define IGAMEINFO_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "mathlib/vector.h"
  13. #include "pluginvariant.h"
  14. //Tony; prefixing everything in this so that i can make IGameInfo an extension of CGameRules and not stomp on anything, since gamerules isn't an entity.
  15. abstract_class IGameInfo
  16. {
  17. public:
  18. // returns an enumerated id for the current game type
  19. virtual const int GetInfo_GameType() = 0;
  20. // returns a name associated with the gametype, if defined.
  21. virtual const char *GetInfo_GameTypeName() = 0;
  22. // returns the team name associated with the number
  23. virtual const char *GetInfo_GetTeamName(int teamNumber) = 0;
  24. // returns how many teams the game has (typically always 4; 0 = unassigned, 1 = spectator, 2 = team1, 3 = team2)
  25. virtual const int GetInfo_GetTeamCount() = 0;
  26. // returns how many players are on a given team
  27. virtual const int GetInfo_NumPlayersOnTeam(int teamNumber) = 0;
  28. // accessor to hook mod specific information about the rules. for TF2, fields such as
  29. virtual bool GetInfo_Custom(int valueType, pluginvariant &outValue, pluginvariant options) = 0;
  30. };
  31. //Interface is very simple, there's not much really needed for the manager, this stuff is just in it's own interface so it's not mixed up with the entity
  32. //or player managers.
  33. #define INTERFACEVERSION_GAMEINFOMANAGER "GameInfoManager001"
  34. abstract_class IGameInfoManager
  35. {
  36. public:
  37. virtual IGameInfo *GetGameInfo() = 0;
  38. };
  39. #endif // IGAMEINFO_H