From ae325c873f64603f3957b3ded623a67088752ba8 Mon Sep 17 00:00:00 2001 From: oy Date: Wed, 23 Mar 2011 13:06:35 +0100 Subject: added friends feature. Closes #24 --- src/engine/client/friends.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/engine/client/friends.h (limited to 'src/engine/client/friends.h') diff --git a/src/engine/client/friends.h b/src/engine/client/friends.h new file mode 100644 index 00000000..e046fc20 --- /dev/null +++ b/src/engine/client/friends.h @@ -0,0 +1,32 @@ +/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */ +/* If you are missing that file, acquire a complete release at teeworlds.com. */ +#ifndef ENGINE_CLIENT_FRIENDS_H +#define ENGINE_CLIENT_FRIENDS_H + +#include + +class CFriends : public IFriends +{ + CFriendInfo m_aFriends[MAX_FRIENDS]; + int m_NumFriends; + + static void ConAddFriend(IConsole::IResult *pResult, void *pUserData); + static void ConRemoveFriend(IConsole::IResult *pResult, void *pUserData); + + static void ConfigSaveCallback(IConfig *pConfig, void *pUserData); + +public: + CFriends(); + + void Init(); + + int NumFriends() const { return m_NumFriends; } + const CFriendInfo *GetFriend(int Index) const; + bool IsFriend(const char *pName, const char *pClan) const; + + void AddFriend(const char *pName, const char *pClan); + void RemoveFriend(const char *pName, const char *pClan); + void RemoveFriend(int Index); +}; + +#endif -- cgit 1.4.1