diff --git a/src/ignition_cells.cpp b/src/ignition_cells.cpp new file mode 100644 index 0000000..9a3cedd --- /dev/null +++ b/src/ignition_cells.cpp @@ -0,0 +1,22 @@ +#include "ignition_cells.hpp" + +#include +#include + +#include "types.h" + +#include "csv.hpp" + +IgnitionCells read_ignition_cells(std::string filename) { + + std::ifstream file(filename); + + CSVIterator loop(file); + loop++; // skip first line + + IgnitionCells ignition_cells; + + for (; loop != CSVIterator(); ++loop) { + ignition_cells.push_back({ atoi((*loop)[0].data()), atoi((*loop)[1].data()) }); + } +} diff --git a/src/ignition_cells.hpp b/src/ignition_cells.hpp new file mode 100644 index 0000000..8ee3508 --- /dev/null +++ b/src/ignition_cells.hpp @@ -0,0 +1,13 @@ +#ifndef _IGNITIONS_CELLS_HPP +#define _IGNITIONS_CELLS_HPP + +#include +#include + +#include "types.h" + +typedef std::vector> IgnitionCells; + +IgnitionCells read_ignition_cells(std::string filename); + +#endif \ No newline at end of file