settings_menu: Create a dedicated class for the settings

This commit is contained in:
2026-01-12 21:34:41 +01:00
parent 24d8a092e4
commit 416d3a2be9
13 changed files with 286 additions and 161 deletions

View File

@@ -2,7 +2,7 @@
* File name: world.cpp
* Author: lejulien
* Date created: 09-01-2026 23:59:55
// Date modified: 10-01-2026 22:00:23
// Date modified: 12-01-2026 22:14:46
* ------
*/
@@ -12,11 +12,11 @@
// Constructor and destructor
World::World(gol::ctx &context) {
_width = context.config_json["screen_width"].get<int>() /
context.config_json["cell_size"].get<int>();
_height = context.config_json["screen_height"].get<int>() /
context.config_json["cell_size"].get<int>();
World::World(std::shared_ptr<gol::ctx> context) {
_width = context->config_json["screen_width"].get<int>() /
context->config_json["cell_size"].get<int>();
_height = context->config_json["screen_height"].get<int>() /
context->config_json["cell_size"].get<int>();
// create world data
this->_data = new std::vector<bool>(_width * _height, false);
}