DDraceNetwork Docs
friends.h
Go to the documentation of this file.
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
10
11class CFriends : public IFriends
12{
14 int m_Foes;
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
Definition: friends.h:12
CFriends()
Definition: friends.cpp:12
static void ConAddFriend(IConsole::IResult *pResult, void *pUserData)
Definition: friends.cpp:19
int NumFriends() const override
Definition: friends.h:28
int m_Foes
Definition: friends.h:14
void RemoveFriend(const char *pName, const char *pClan) override
Definition: friends.cpp:123
const CFriendInfo * GetFriend(int Index) const override
Definition: friends.cpp:63
void Init(bool Foes=false) override
Definition: friends.cpp:37
static void ConfigSaveCallback(IConfigManager *pConfigManager, void *pUserData)
Definition: friends.cpp:162
int m_NumFriends
Definition: friends.h:15
static void ConRemoveFriend(IConsole::IResult *pResult, void *pUserData)
Definition: friends.cpp:25
static void ConFriends(IConsole::IResult *pResult, void *pUserData)
Definition: friends.cpp:31
int GetFriendState(const char *pName, const char *pClan) const override
Definition: friends.cpp:68
void Friends()
Definition: friends.cpp:147
bool IsFriend(const char *pName, const char *pClan, bool PlayersOnly) const override
Definition: friends.cpp:89
void AddFriend(const char *pName, const char *pClan) override
Definition: friends.cpp:102
CFriendInfo m_aFriends[MAX_FRIENDS]
Definition: friends.h:13
Definition: config.h:9
Definition: console.h:45
Definition: friends.h:19
@ MAX_FRIENDS
Definition: friends.h:28
Definition: friends.h:11