Rename the hack spike of the game idea to its final name. Start a test of FTXUI for the game.
This commit is contained in:
parent
00597c0aaa
commit
aee2ac5b27
3 changed files with 37 additions and 2 deletions
|
@ -24,7 +24,10 @@ const auto ERROR = fmt::emphasis::bold | fg(fmt::color::red);
|
||||||
class GameEngine {
|
class GameEngine {
|
||||||
int hit_points = 0;
|
int hit_points = 0;
|
||||||
map<string, int> damage_types{
|
map<string, int> damage_types{
|
||||||
{"error", 4}, {"warning", 1}};
|
{"error", 4},
|
||||||
|
{"warning", 1},
|
||||||
|
{"note", 1},
|
||||||
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GameEngine(int hp) : hit_points(hp) {};
|
GameEngine(int hp) : hit_points(hp) {};
|
24
ftxtest.cpp
Normal file
24
ftxtest.cpp
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#include <ftxui/dom/elements.hpp>
|
||||||
|
#include <ftxui/screen/screen.hpp>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
int main(void) {
|
||||||
|
using namespace ftxui;
|
||||||
|
|
||||||
|
// Define the document
|
||||||
|
Element document =
|
||||||
|
hbox({
|
||||||
|
text("left") | border,
|
||||||
|
text("middle") | border | flex,
|
||||||
|
text("right") | border,
|
||||||
|
});
|
||||||
|
|
||||||
|
auto screen = Screen::Create(
|
||||||
|
Dimension::Full(), // Width
|
||||||
|
Dimension::Fit(document) // Height
|
||||||
|
);
|
||||||
|
Render(screen, document);
|
||||||
|
screen.Print();
|
||||||
|
|
||||||
|
return EXIT_SUCCESS;
|
||||||
|
}
|
10
meson.build
10
meson.build
|
@ -17,13 +17,21 @@ efsw_proj = cmake.subproject('efsw')
|
||||||
efsw_dep = efsw_proj.dependency('efsw')
|
efsw_dep = efsw_proj.dependency('efsw')
|
||||||
|
|
||||||
fmt = dependency('fmt')
|
fmt = dependency('fmt')
|
||||||
|
ftxui_screen = dependency('ftxui-screen')
|
||||||
|
ftxui_dom = dependency('ftxui-dom')
|
||||||
|
ftxui_component = dependency('ftxui-component')
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
fmt, libgit2package_dep, efsw_dep,
|
fmt, libgit2package_dep, efsw_dep,
|
||||||
|
ftxui_screen, ftxui_dom, ftxui_component
|
||||||
]
|
]
|
||||||
|
|
||||||
executable('watchgit', 'watchgit.cpp',
|
executable('escape_turings_tarpit',
|
||||||
|
'escape_turings_tarpit.cpp',
|
||||||
dependencies: dependencies)
|
dependencies: dependencies)
|
||||||
|
|
||||||
executable('regtest', 'regtest.cpp',
|
executable('regtest', 'regtest.cpp',
|
||||||
dependencies: [fmt])
|
dependencies: [fmt])
|
||||||
|
|
||||||
|
executable('ftxtest', 'ftxtest.cpp',
|
||||||
|
dependencies: dependencies)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue