summaryrefslogtreecommitdiff
path: root/src/io/IOManager.cpp
blob: ce7db5dc093e5e099f7e5f80ba8f997397de4ba6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "IOManager.hpp"
#include "../debug/log.hpp"
#include "inputManager.hpp"

CIOManager::CIOManager() {
	log(LOG, "IOManager: initialized");
}

CIOManager::~CIOManager() {
	m_vIO.clear();
	log(SYS, "IOManager: bye");
}

const std::vector<CIOManager::SIO> &CIOManager::getIO() const {
	return m_vIO;
}

void CIOManager::addLog(const SLog &log) {
	m_vIO.push_back({.log = log});
	if (g_pInputManager)
		g_pInputManager->updateIO();
}

void CIOManager::addMessage(const CChatManager::SMessage &msg) {
	m_vIO.push_back({.msg = msg});
	if (g_pInputManager)
		g_pInputManager->updateIO();
}

void CIOManager::addCustom(const std::pair<std::string, std::string> &custom) {
	m_vIO.push_back({.custom = custom});
	if (g_pInputManager)
		g_pInputManager->updateIO();
}