Matrix now just does the dumping but I need to make this more formal I think.
This commit is contained in:
parent
eb0ca38e30
commit
56b26e1c4a
9 changed files with 44 additions and 33 deletions
25
matrix.cpp
Normal file
25
matrix.cpp
Normal file
|
@ -0,0 +1,25 @@
|
|||
#include "matrix.hpp"
|
||||
#include "constants.hpp"
|
||||
#include <fmt/core.h>
|
||||
|
||||
using namespace fmt;
|
||||
|
||||
void matrix_dump(const std::string &msg, Matrix &map, int show_x, int show_y) {
|
||||
println("----------------- {}", msg);
|
||||
for(size_t y = 0; y < map.size(); y++) {
|
||||
for(size_t x = 0; x < map[y].size(); x++) {
|
||||
int col = map[y][x];
|
||||
|
||||
if(int(x) == show_x && int(y) == show_y) {
|
||||
print("{:x}<", col);
|
||||
} else if(col == WALL_PATH_LIMIT) {
|
||||
print("# ");
|
||||
} else if(col > 15) {
|
||||
print("* ");
|
||||
} else {
|
||||
print("{:x} ", col);
|
||||
}
|
||||
}
|
||||
print("\n");
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue