Merge branch 'master' into feature/rla-19_Zoom
This commit is contained in:
@@ -11,6 +11,6 @@ std::string LuaContextManager::get_key(std::string args) {
|
||||
// TODO: Switch the arg to a struct and use that to init libraries
|
||||
std::shared_ptr<sol::state> LuaContextManager::load_resource(std::string args) {
|
||||
auto lua = std::make_shared<sol::state>();
|
||||
lua->open_libraries(sol::lib::base, sol::lib::package, sol::lib::math, sol::lib::os);
|
||||
lua->open_libraries(sol::lib::base, sol::lib::package, sol::lib::math, sol::lib::table);
|
||||
return lua;
|
||||
}
|
||||
|
||||
@@ -45,3 +45,7 @@ int TileMap::get_width() {
|
||||
int TileMap::get_height() {
|
||||
return grid.get_height();
|
||||
}
|
||||
|
||||
TileMap TileMap::clone() {
|
||||
return {this->get_width(), this->get_height(), this->wall_tile, this->floor_tile};
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ public:
|
||||
bool is_wall(int x, int y);
|
||||
int get_width();
|
||||
int get_height();
|
||||
TileMap clone();
|
||||
|
||||
TileMap(int width, int height, char wall_tile, char floor_tile) {
|
||||
this->grid = Grid2D<char>(width, height);
|
||||
|
||||
@@ -109,6 +109,9 @@ void Visualizer::initialize_context() {
|
||||
tilemap_lua["draw_wall"] = &TileMap::draw_wall;
|
||||
tilemap_lua["fill"] = &TileMap::fill;
|
||||
tilemap_lua["is_wall"] = &TileMap::is_wall;
|
||||
tilemap_lua["clone"] = &TileMap::clone;
|
||||
tilemap_lua["get_width"] = &TileMap::get_width;
|
||||
tilemap_lua["get_height"] = &TileMap::get_height;
|
||||
|
||||
auto algo_manager_lua = lua->new_usertype<AlgorithmManager>("AlgorithmManager", sol::no_constructor);
|
||||
algo_manager_lua["register_algorithm"] = &AlgorithmManager::register_algorithm;
|
||||
|
||||
Reference in New Issue
Block a user