Files
AVA2/src/game/messenger_state.h
T

32 lines
1.1 KiB
C++

#pragma once
// AVA2 UserInterface/PythonMessenger.cpp/.h, including observable callback order.
#include <Python.h>
#include <cstdint>
#include <map>
#include <set>
#include <string>
namespace ava2 {
class MessengerState {
public:
void SetHandler(PyObject* handler);
void Destroy(); // Windows clears lists but retains the handler.
void Reset(); // Runtime teardown also releases the owned Python reference.
void RemoveFriend(const std::string& name);
bool IsFriend(const std::string& name) const;
void FriendLogin(const std::string& name);
void FriendLogout(const std::string& name);
void SetMobile(const std::string& name,uint8_t state);
void AppendGuildMember(const std::string& name);
void RemoveGuildMember(const std::string& name);
void RemoveAllGuildMember();
void LoginGuildMember(const std::string& name);
void LogoutGuildMember(const std::string& name);
void RefreshGuildMember();
private:
std::set<std::string> friends;
std::map<std::string,uint8_t> guild;
PyObject* handler=nullptr;
};
MessengerState& GetMessengerState();
}