#include <iostream>
#include <vector>
#include <string>
///----------------------------------------------------------------------------|
/// Конфигурация программы.
///----------------------------------------------------------------------------:
struct Config
{
unsigned H = 10 ; /// Высота доски.
unsigned W = 30 ; /// Ширина доски.
wchar_t C = '.'; /// Символ заполнения.
void load_from_file(){ /* ... */ }
};
const Config cfg;
///----------------------------------------------------------------------------|
/// Виртуальный экран.
///----------------------------------------------------------------------------:
struct VScreen
{ VScreen() : mat(cfg.H, std::wstring(cfg.W, cfg.C))
{
}
std::vector<std::wstring> mat;
};
///----------------------------------------------------------------------------|
/// Конкретный способ или девайс вывода на монитор.
///----------------------------------------------------------------------------:
struct Hard
{
Hard& operator<<(const VScreen& scr)
{ for(const auto& s : scr.mat)
{ std::wcout << s << '\n';
} std::wcout << '\n';
return *this;
}
};
///--------------------------|
/// Тест. |
///--------------------------:
void test()
{ VScreen scr;
Hard hard;
hard << scr;
}
///----------------------------------------------------------------------------|
/// Старт.
///----------------------------------------------------------------------------:
int main()
{
test();
std::cin.get();
}