1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef ENGINE_CLIENT_FRIENDS_H
4#define ENGINE_CLIENT_FRIENDS_H
5
6#include <engine/console.h>
7#include <engine/friends.h>
8
9class IConfigManager;
10
11class CFriends : public IFriends
12{
13 CFriendInfo m_aFriends[MAX_FRIENDS];
14 int m_Foes;
15 int m_NumFriends;
16
17 static void ConAddFriend(IConsole::IResult *pResult, void *pUserData);
18 static void ConRemoveFriend(IConsole::IResult *pResult, void *pUserData);
19 static void ConFriends(IConsole::IResult *pResult, void *pUserData);
20
21 static void ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserData);
22
23public:
24 CFriends();
25
26 void Init(bool Foes = false) override;
27
28 int NumFriends() const override { return m_NumFriends; }
29 const CFriendInfo *GetFriend(int Index) const override;
30 int GetFriendState(const char *pName, const char *pClan) const override;
31 bool IsFriend(const char *pName, const char *pClan, bool PlayersOnly) const override;
32
33 void AddFriend(const char *pName, const char *pClan) override;
34 void RemoveFriend(const char *pName, const char *pClan) override;
35 void RemoveFriend(int Index);
36 void Friends();
37};
38
39#endif
40