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.

51 lines
1.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Parties are a specific type of CPlayerGroup with a leader that can invite and kick members.
  4. //
  5. //=============================================================================
  6. #ifndef PARTY_H
  7. #define PARTY_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "playergroup.h"
  12. namespace GCSDK
  13. {
  14. class CSharedObject;
  15. class IParty : public IPlayerGroup
  16. {
  17. public:
  18. virtual ~IParty() { }
  19. };
  20. class CPartyInvite : public GCSDK::CProtoBufSharedObject<CSOPartyInvite, k_EProtoObjectPartyInvite>, public GCSDK::IPlayerGroupInvite
  21. {
  22. //This is disabled since people shouldn't create these objects directly and should instead instantiate game specific versions of them
  23. //DECLARE_CLASS_MEMPOOL( CPartyInvite );
  24. public:
  25. const static int k_nTypeID = k_EProtoObjectPartyInvite;
  26. virtual const CSteamID GetSenderID() const { return Obj().sender_id(); }
  27. virtual PlayerGroupID_t GetGroupID() const { return Obj().group_id(); }
  28. virtual const char* GetSenderName() const { return Obj().sender_name().c_str(); }
  29. virtual GCSDK::CSharedObject* GetSharedObject() { return this; }
  30. #ifdef GC
  31. virtual void YldInitFromPlayerGroup( GCSDK::IPlayerGroup *pPlayerGroup );
  32. // NOTE: These do not dirty fields
  33. virtual void SetSenderID( const CSteamID &steamID ) { Obj().set_sender_id( steamID.ConvertToUint64() ); }
  34. virtual void SetGroupID( PlayerGroupID_t nGroupID ) { Obj().set_group_id( nGroupID ); }
  35. virtual void SetSenderName( const char *szName ) { Obj().set_sender_name( szName ); }
  36. #endif
  37. };
  38. }
  39. #endif