2011-03-23 12:06:35 +00:00
|
|
|
/* (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 <engine/friends.h>
|
|
|
|
|
|
|
|
class CFriends : public IFriends
|
|
|
|
{
|
|
|
|
CFriendInfo m_aFriends[MAX_FRIENDS];
|
2015-07-22 20:16:49 +00:00
|
|
|
int m_Foes;
|
2011-03-23 12:06:35 +00:00
|
|
|
int m_NumFriends;
|
|
|
|
|
2011-08-13 00:11:06 +00:00
|
|
|
static void ConAddFriend(IConsole::IResult *pResult, void *pUserData);
|
|
|
|
static void ConRemoveFriend(IConsole::IResult *pResult, void *pUserData);
|
2015-07-28 14:13:29 +00:00
|
|
|
static void ConFriends(IConsole::IResult *pResult, void *pUserData);
|
2011-03-23 12:06:35 +00:00
|
|
|
|
|
|
|
static void ConfigSaveCallback(IConfig *pConfig, void *pUserData);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-23 12:06:35 +00:00
|
|
|
public:
|
|
|
|
CFriends();
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2015-07-22 20:16:49 +00:00
|
|
|
void Init(bool Foes = false);
|
2011-04-13 18:37:12 +00:00
|
|
|
|
2011-03-23 12:06:35 +00:00
|
|
|
int NumFriends() const { return m_NumFriends; }
|
2011-04-13 18:37:12 +00:00
|
|
|
const CFriendInfo *GetFriend(int Index) const;
|
2011-06-26 15:10:13 +00:00
|
|
|
int GetFriendState(const char *pName, const char *pClan) const;
|
2011-04-02 17:51:05 +00:00
|
|
|
bool IsFriend(const char *pName, const char *pClan, bool PlayersOnly) const;
|
2011-03-23 12:06:35 +00:00
|
|
|
|
|
|
|
void AddFriend(const char *pName, const char *pClan);
|
|
|
|
void RemoveFriend(const char *pName, const char *pClan);
|
|
|
|
void RemoveFriend(int Index);
|
2015-07-28 14:13:29 +00:00
|
|
|
void Friends();
|
2011-03-23 12:06:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|