diff --git a/src/graphics/input/focus.cpp b/src/graphics/input/focus.cpp index ee0b17c..627452d 100644 --- a/src/graphics/input/focus.cpp +++ b/src/graphics/input/focus.cpp @@ -19,8 +19,8 @@ using namespace Sim::Graphics; static glm::vec<3, double> trigger_near; static glm::vec<3, double> trigger_far; -static std::vector> stack; -static std::unique_ptr state = nullptr; +static std::vector> stack; +static std::unique_ptr state = nullptr; static bool mouse_visible = false; static bool mouse_locked = false; static bool triggered = false; @@ -179,7 +179,7 @@ void Focus::clear_mouse_locked() clear_focus(); } -void Focus::set(std::unique_ptr f) +void Focus::set(std::unique_ptr f) { if(state != nullptr) { diff --git a/src/graphics/input/focus.hpp b/src/graphics/input/focus.hpp index 381d340..a78f9aa 100644 --- a/src/graphics/input/focus.hpp +++ b/src/graphics/input/focus.hpp @@ -8,9 +8,9 @@ namespace Sim::Graphics::Focus { -struct Focus +struct FocusType { - virtual ~Focus() { } + virtual ~FocusType() { } virtual bool cursor_is_visible() { return true; } virtual void on_keypress(int key, int sc, int action, int mods) { } virtual void on_mouse_button(int button, int action, int mods) { } @@ -28,7 +28,7 @@ bool is_mouse_locked(); void clear_mouse_locked(); glm::vec<3, double> get_trigger_near(); glm::vec<3, double> get_trigger_far(); -void set(std::unique_ptr f); +void set(std::unique_ptr f); void on_keypress(int key, int sc, int action, int mods); void on_mouse_button(int button, int action, int mods); void on_cursor_pos(double x, double y); diff --git a/src/graphics/mesh/arrays.cpp b/src/graphics/mesh/arrays.cpp index bb8d7e9..8750dfc 100644 --- a/src/graphics/mesh/arrays.cpp +++ b/src/graphics/mesh/arrays.cpp @@ -19,7 +19,7 @@ static void* ptr_diff(void* a, void* b) void Arrays::vertex_attrib_pointers() { - vertex v; + Vertex v; glVertexAttribLPointer(0, 1, GL_UNSIGNED_INT64_ARB, sizeof(v), ptr_diff(&v.texid, &v)); glEnableVertexAttribArray(0); diff --git a/src/graphics/mesh/arrays.hpp b/src/graphics/mesh/arrays.hpp index d780b0b..aea2384 100644 --- a/src/graphics/mesh/arrays.hpp +++ b/src/graphics/mesh/arrays.hpp @@ -6,7 +6,7 @@ namespace Sim::Graphics::Arrays { -struct vertex +struct Vertex { unsigned long texid = 0; glm::vec2 texpos = {0, 0}; diff --git a/src/graphics/mesh/font.cpp b/src/graphics/mesh/font.cpp index 97a5646..60afcc5 100644 --- a/src/graphics/mesh/font.cpp +++ b/src/graphics/mesh/font.cpp @@ -15,7 +15,7 @@ using namespace Sim::Graphics; -struct character +struct Character { unsigned long handle; float advance; @@ -23,7 +23,7 @@ struct character glm::vec2 bearing; }; -static character chars[128]; +static Character chars[128]; void Font::init() { @@ -63,7 +63,7 @@ void Font::init() int offx = face->glyph->bitmap_left; int offy = face->glyph->bitmap_top; - character& c = chars[i]; + Character& c = chars[i]; c.advance = face->glyph->advance.x * m / 64.0; c.size = {width * m, height * m}; c.bearing = {offx * m, offy * m}; @@ -95,7 +95,7 @@ void Font::init() void Mesh::load_text(const char* text, double size) { - std::vector vertices; + std::vector vertices; std::vector indices; float x = 0, y = size; @@ -111,7 +111,7 @@ void Mesh::load_text(const char* text, double size) for(unsigned int i = 0; text[i] != '\0'; i++) { char c = text[i]; - character ch = chars[c]; + Character ch = chars[c]; if(c == '\n') { @@ -136,10 +136,10 @@ void Mesh::load_text(const char* text, double size) float ex = sx + ch.size.x * size; float ey = sy + ch.size.y * size; - vertices.push_back(Arrays::vertex(ch.handle, {0, 0}, {sx, sy, 0, 1}, {0, 0, -1})); - vertices.push_back(Arrays::vertex(ch.handle, {0, 1}, {sx, ey, 0, 1}, {0, 0, -1})); - vertices.push_back(Arrays::vertex(ch.handle, {1, 0}, {ex, sy, 0, 1}, {0, 0, -1})); - vertices.push_back(Arrays::vertex(ch.handle, {1, 1}, {ex, ey, 0, 1}, {0, 0, -1})); + vertices.push_back(Arrays::Vertex(ch.handle, {0, 0}, {sx, sy, 0, 1}, {0, 0, -1})); + vertices.push_back(Arrays::Vertex(ch.handle, {0, 1}, {sx, ey, 0, 1}, {0, 0, -1})); + vertices.push_back(Arrays::Vertex(ch.handle, {1, 0}, {ex, sy, 0, 1}, {0, 0, -1})); + vertices.push_back(Arrays::Vertex(ch.handle, {1, 1}, {ex, ey, 0, 1}, {0, 0, -1})); indices.insert(indices.end(), &index[0], &index[6]); at += 4; diff --git a/src/graphics/mesh/mesh.cpp b/src/graphics/mesh/mesh.cpp index 8dc2287..8a4c031 100644 --- a/src/graphics/mesh/mesh.cpp +++ b/src/graphics/mesh/mesh.cpp @@ -20,7 +20,7 @@ void Mesh::add(const Mesh& o, glm::mat4 mat) for(unsigned int i = 0; i < o.vertices.size(); i++) { - Arrays::vertex v = o.vertices[i]; + Arrays::Vertex v = o.vertices[i]; v.normal = mat3 * v.normal; v.pos = mat * v.pos; vertices.push_back(v); @@ -32,7 +32,7 @@ void Mesh::add(const Mesh& o, glm::mat4 mat) } } -void Mesh::set_vertices(const Arrays::vertex* data, size_t size) +void Mesh::set_vertices(const Arrays::Vertex* data, size_t size) { vertices.clear(); vertices.reserve(size); diff --git a/src/graphics/mesh/mesh.hpp b/src/graphics/mesh/mesh.hpp index c7bafa4..ccce880 100644 --- a/src/graphics/mesh/mesh.hpp +++ b/src/graphics/mesh/mesh.hpp @@ -15,12 +15,12 @@ namespace Sim::Graphics struct Mesh { - std::vector vertices; + std::vector vertices; std::vector indices; constexpr Mesh() { } - void set_vertices(const Arrays::vertex* data, size_t size); + void set_vertices(const Arrays::Vertex* data, size_t size); void set_indices(const unsigned int* data, size_t size); void load_model(std::string base, std::string path); void load_model(std::string path) { load_model(".", path); } diff --git a/src/graphics/mesh/model.cpp b/src/graphics/mesh/model.cpp index 5926457..e0c6074 100644 --- a/src/graphics/mesh/model.cpp +++ b/src/graphics/mesh/model.cpp @@ -17,17 +17,17 @@ using namespace Sim::Graphics; -struct proc_state +struct ProcState { unsigned int offset = 0; std::string base; - std::vector vertices; + std::vector vertices; std::vector indices; std::unordered_map handles; }; -static unsigned int proc_texture(const proc_state& state, aiMaterial* mat, const aiScene* scene) +static unsigned int proc_texture(const ProcState& state, aiMaterial* mat, const aiScene* scene) { for(int i = 0; i < 0x0d; i++) { @@ -59,7 +59,7 @@ static unsigned int proc_texture(const proc_state& state, aiMaterial* mat, const return Texture::handle_white; } -static void proc_mesh(proc_state& state, glm::mat4 mat, aiMesh* mesh, const aiScene* scene) +static void proc_mesh(ProcState& state, glm::mat4 mat, aiMesh* mesh, const aiScene* scene) { aiMaterial* material = scene->mMaterials[mesh->mMaterialIndex]; unsigned int handle = proc_texture(state, material, scene); @@ -68,7 +68,7 @@ static void proc_mesh(proc_state& state, glm::mat4 mat, aiMesh* mesh, const aiSc for(unsigned int i = 0; i < mesh->mNumVertices; i++) { - Arrays::vertex vertex; + Arrays::Vertex vertex; auto [x, y, z] = mesh->mVertices[i]; vertex.pos = glm::vec4(x, y, z, 1) * mat; @@ -102,7 +102,7 @@ static void proc_mesh(proc_state& state, glm::mat4 mat, aiMesh* mesh, const aiSc state.offset += mesh->mNumVertices; } -static void proc_node(proc_state& state, glm::mat4 mat, aiNode* node, const aiScene* scene) +static void proc_node(ProcState& state, glm::mat4 mat, aiNode* node, const aiScene* scene) { auto m = node->mTransformation; mat = glm::mat4( @@ -145,7 +145,7 @@ static unsigned int proc_embedded_texture(aiTexture* tex) void Mesh::load_model(std::string base, std::string filename) { - proc_state state {.base = base}; + ProcState state {.base = base}; std::string path = base + "/" + filename; Assimp::Importer importer; diff --git a/src/graphics/monitor/core.cpp b/src/graphics/monitor/core.cpp index 1f9e709..f6ac8e4 100644 --- a/src/graphics/monitor/core.cpp +++ b/src/graphics/monitor/core.cpp @@ -31,7 +31,7 @@ static void set_all(bool state) } } -struct core_monitor : public Focus::Focus +struct CoreMonitor : public Focus::FocusType { virtual void on_keypress(int key, int sc, int action, int mods) { @@ -72,14 +72,14 @@ struct core_monitor : public Focus::Focus } }; -struct core_joystick : public Focus::Focus +struct CoreJoystick : public Focus::FocusType { virtual void on_cursor_pos(double x, double y) { Sim::System::active.reactor->add_rod_speed(y * 1e-6); } - virtual ~core_joystick() + virtual ~CoreJoystick() { Sim::System::active.reactor->reset_rod_speed(); } @@ -114,7 +114,7 @@ void Core::init() mesh1.set(rmesh, GL_STATIC_DRAW); unsigned int indices[] = {0, 1, 3, 0, 3, 2}; - Arrays::vertex vertices[] = { + Arrays::Vertex vertices[] = { {Texture::handle_white, {0, 0}, {-0.75, -0.75, 0, 1}, {0, 0, -1}}, {Texture::handle_white, {0, 1}, {-0.75, 0.75, 0, 1}, {0, 0, -1}}, {Texture::handle_white, {1, 0}, { 0.75, -0.75, 0, 1}, {0, 0, -1}}, @@ -145,9 +145,9 @@ void Core::update(double dt) Sim::System& sys = Sim::System::active; if(m_monitor.check_focus()) - Focus::set(std::make_unique()); + Focus::set(std::make_unique()); if(m_joystick.check_focus()) - Focus::set(std::make_unique()); + Focus::set(std::make_unique()); if(m_scram.check_focus()) sys.reactor->scram(); if(m_buttons[0].check_focus()) diff --git a/src/graphics/monitor/core.hpp b/src/graphics/monitor/core.hpp index 902d4ef..e4a3189 100644 --- a/src/graphics/monitor/core.hpp +++ b/src/graphics/monitor/core.hpp @@ -3,7 +3,7 @@ #include "../mesh/glmesh.hpp" -namespace Sim::Graphics::monitor +namespace Sim::Graphics::Monitor { class Core diff --git a/src/graphics/monitor/primary_loop.cpp b/src/graphics/monitor/primary_loop.cpp index 9d74389..df2e8ed 100644 --- a/src/graphics/monitor/primary_loop.cpp +++ b/src/graphics/monitor/primary_loop.cpp @@ -15,16 +15,16 @@ using namespace Sim::Graphics; using namespace Sim::Graphics::Monitor; -struct valve_joystick : public Focus::Focus +struct ValveJoystick : public Focus::FocusType { Sim::Coolant::Valve* active; - valve_joystick(Sim::Coolant::Valve* v) : active(v) + ValveJoystick(Sim::Coolant::Valve* v) : active(v) { } - virtual ~valve_joystick() + virtual ~ValveJoystick() { active->clear_open_speed(); } @@ -159,9 +159,9 @@ void PrimaryLoop::update(double dt) } if(m_joystick_turbine_bypass.check_focus()) - Focus::set(std::make_unique(sys.turbine_bypass_valve.get())); + Focus::set(std::make_unique(sys.turbine_bypass_valve.get())); if(m_joystick_turbine_inlet.check_focus()) - Focus::set(std::make_unique(sys.turbine_inlet_valve.get())); + Focus::set(std::make_unique(sys.turbine_inlet_valve.get())); if(m_switch_pump.check_focus()) sys.primary_pump->powered = !sys.primary_pump->powered; if(m_switch_inlet.check_focus()) diff --git a/src/graphics/monitor/primary_loop.hpp b/src/graphics/monitor/primary_loop.hpp index 576cb23..ee5e724 100644 --- a/src/graphics/monitor/primary_loop.hpp +++ b/src/graphics/monitor/primary_loop.hpp @@ -3,7 +3,7 @@ #include "../mesh/glmesh.hpp" -namespace Sim::Graphics::monitor +namespace Sim::Graphics::Monitor { class PrimaryLoop diff --git a/src/graphics/monitor/secondary_loop.hpp b/src/graphics/monitor/secondary_loop.hpp index 9f8a47b..b3a7f6c 100644 --- a/src/graphics/monitor/secondary_loop.hpp +++ b/src/graphics/monitor/secondary_loop.hpp @@ -3,7 +3,7 @@ #include "../mesh/glmesh.hpp" -namespace Sim::Graphics::monitor +namespace Sim::Graphics::Monitor { class SecondaryLoop diff --git a/src/graphics/monitor/turbine.hpp b/src/graphics/monitor/turbine.hpp index f1ebfea..f2d9e8a 100644 --- a/src/graphics/monitor/turbine.hpp +++ b/src/graphics/monitor/turbine.hpp @@ -3,7 +3,7 @@ #include "../mesh/glmesh.hpp" -namespace Sim::Graphics::monitor +namespace Sim::Graphics::Monitor { class Turbine diff --git a/src/graphics/monitor/vessel.cpp b/src/graphics/monitor/vessel.cpp index 230a109..7cc0872 100644 --- a/src/graphics/monitor/vessel.cpp +++ b/src/graphics/monitor/vessel.cpp @@ -78,7 +78,7 @@ void Vessel::update(double dt) continue; } - auto br = (Sim::Reactor::control::BoronRod*)r; + auto br = (Sim::Reactor::Control::BoronRod*)r; double v = br->get_inserted(); if(v > crod_max) diff --git a/src/graphics/monitor/vessel.hpp b/src/graphics/monitor/vessel.hpp index 79216e7..30d33fa 100644 --- a/src/graphics/monitor/vessel.hpp +++ b/src/graphics/monitor/vessel.hpp @@ -3,7 +3,7 @@ #include "../mesh/glmesh.hpp" -namespace Sim::Graphics::monitor +namespace Sim::Graphics::Monitor { class Vessel diff --git a/src/graphics/ui.cpp b/src/graphics/ui.cpp index 03b3535..36a3a16 100644 --- a/src/graphics/ui.cpp +++ b/src/graphics/ui.cpp @@ -18,8 +18,8 @@ using namespace Sim::Graphics; -static GLMesh StaticMeshData; -static widget::Clock WidgetClock; +static GLMesh s_mesh; +static Widget::Clock w_clock; void UI::init() { @@ -27,24 +27,24 @@ void UI::init() unsigned int handle = Texture::handle_white; const unsigned int indices[] = {0, 1, 3, 0, 3, 2}; - const Arrays::vertex vertices[] = { - Arrays::vertex(handle, {0, 0}, {-1, -1, 0, 1}, {0, 0, -1}), - Arrays::vertex(handle, {0, 1}, {-1, 1, 0, 1}, {0, 0, -1}), - Arrays::vertex(handle, {1, 0}, { 1, -1, 0, 1}, {0, 0, -1}), - Arrays::vertex(handle, {1, 1}, { 1, 1, 0, 1}, {0, 0, -1}), + const Arrays::Vertex vertices[] = { + Arrays::Vertex(handle, {0, 0}, {-1, -1, 0, 1}, {0, 0, -1}), + Arrays::Vertex(handle, {0, 1}, {-1, 1, 0, 1}, {0, 0, -1}), + Arrays::Vertex(handle, {1, 0}, { 1, -1, 0, 1}, {0, 0, -1}), + Arrays::Vertex(handle, {1, 1}, { 1, 1, 0, 1}, {0, 0, -1}), }; m.set_indices(indices, 6); m.set_vertices(vertices, 4); - StaticMeshData.bind(); - StaticMeshData.set(m, GL_STATIC_DRAW); - StaticMeshData.colour_matrix = glm::scale(glm::mat4(1), glm::vec3(1) * 0.75f); + s_mesh.bind(); + s_mesh.set(m, GL_STATIC_DRAW); + s_mesh.colour_matrix = glm::scale(glm::mat4(1), glm::vec3(1) * 0.75f); } void UI::update(double dt) { - WidgetClock.update(dt); + w_clock.update(dt); } void UI::render() @@ -58,10 +58,10 @@ void UI::render() glUniformMatrix4fv(Shader::gl_projection, 1, false, &mat_projection[0][0]); glUniformMatrix4fv(Shader::gl_camera, 1, false, &mat_camera[0][0]); - StaticMeshData.bind(); - StaticMeshData.uniform(); - StaticMeshData.render(); + s_mesh.bind(); + s_mesh.uniform(); + s_mesh.render(); - WidgetClock.render(); + w_clock.render(); } diff --git a/src/graphics/widget/clock.hpp b/src/graphics/widget/clock.hpp index 503e23f..f96be43 100644 --- a/src/graphics/widget/clock.hpp +++ b/src/graphics/widget/clock.hpp @@ -3,7 +3,7 @@ #include "../mesh/glmesh.hpp" -namespace Sim::Graphics::widget +namespace Sim::Graphics::Widget { struct Clock diff --git a/src/graphics/window.cpp b/src/graphics/window.cpp index 284eed5..90c4079 100644 --- a/src/graphics/window.cpp +++ b/src/graphics/window.cpp @@ -33,11 +33,11 @@ static GLFWwindow* win; static bool win_should_close = false; static GLMesh mesh_scene; -static monitor::Vessel monitor_vessel; -static monitor::Core monitor_core; -static monitor::PrimaryLoop monitor_primary_loop; -static monitor::SecondaryLoop monitor_secondary_loop; -static monitor::Turbine monitor_turbine; +static Monitor::Vessel monitor_vessel; +static Monitor::Core monitor_core; +static Monitor::PrimaryLoop monitor_primary_loop; +static Monitor::SecondaryLoop monitor_secondary_loop; +static Monitor::Turbine monitor_turbine; glm::mat4 Window::projection_matrix; diff --git a/src/reactor/builder.cpp b/src/reactor/builder.cpp index 5be158a..39b3f3b 100644 --- a/src/reactor/builder.cpp +++ b/src/reactor/builder.cpp @@ -11,7 +11,7 @@ using namespace Sim::Reactor; -Sim::Reactor::Reactor Sim::Reactor::Builder(const int W, const int H, const double CW, const double CH, fuel::FuelRod fr, coolant::Vessel* v, const char** lines) +Sim::Reactor::Reactor Sim::Reactor::Builder(const int W, const int H, const double CW, const double CH, Fuel::FuelRod fr, Coolant::Vessel* v, const char** lines) { std::vector> arr(W * H); @@ -24,19 +24,19 @@ Sim::Reactor::Reactor Sim::Reactor::Builder(const int W, const int H, const doub switch(c) { case 'F': - r = std::make_unique(fr); + r = std::make_unique(fr); break; case 'C': - r = std::make_unique(v); + r = std::make_unique(v); break; case 'G': - r = std::make_unique(); + r = std::make_unique(); break; case 'H': - r = std::make_unique(); + r = std::make_unique(); break; case 'P': - r = std::make_unique(v); + r = std::make_unique(v); break; default: r = std::make_unique(); @@ -49,22 +49,22 @@ Sim::Reactor::Reactor Sim::Reactor::Builder(const int W, const int H, const doub return Reactor(&arr[0], W, H, CW, CH); } -std::unique_ptr Sim::Reactor::load_rod(const Json::Value& node, coolant::Vessel* v) +std::unique_ptr Sim::Reactor::load_rod(const Json::Value& node, Coolant::Vessel* v) { int id = node["id"].asInt(); switch(id) { case 1: - return std::make_unique(node); + return std::make_unique(node); case 2: - return std::make_unique(node, v); + return std::make_unique(node, v); case 3: - return std::make_unique(node); + return std::make_unique(node); case 4: - return std::make_unique(node); + return std::make_unique(node); case 5: - return std::make_unique(node, v); + return std::make_unique(node, v); } return std::make_unique(); diff --git a/src/reactor/builder.hpp b/src/reactor/builder.hpp index bdce4d9..7aa9bae 100644 --- a/src/reactor/builder.hpp +++ b/src/reactor/builder.hpp @@ -11,8 +11,8 @@ namespace Sim::Reactor { -Reactor Builder(const int W, const int H, const double CW, const double CH, fuel::FuelRod fr, coolant::Vessel* v, const char** lines); -std::unique_ptr load_rod(const Json::Value& node, coolant::Vessel* v); +Reactor Builder(const int W, const int H, const double CW, const double CH, Fuel::FuelRod fr, Coolant::Vessel* v, const char** lines); +std::unique_ptr load_rod(const Json::Value& node, Coolant::Vessel* v); }; diff --git a/src/reactor/control/boron_rod.cpp b/src/reactor/control/boron_rod.cpp index 1af1db3..7cea6f6 100644 --- a/src/reactor/control/boron_rod.cpp +++ b/src/reactor/control/boron_rod.cpp @@ -9,7 +9,7 @@ constexpr double boron_density = 2340000; // g/m^3 constexpr double boron_molar_mass = 10; // g/mol constexpr double boron_molar_density = boron_density / boron_molar_mass; // mol/m^3 -BoronRod::BoronRod(const Json::Value& node, coolant::Vessel* v) : coolant::Pipe(node, v) +BoronRod::BoronRod(const Json::Value& node, Coolant::Vessel* v) : Coolant::Pipe(node, v) { inserted = node["inserted"].asDouble(); absorbed = node["absorbed"].asDouble(); @@ -17,13 +17,13 @@ BoronRod::BoronRod(const Json::Value& node, coolant::Vessel* v) : coolant::Pipe( Json::Value BoronRod::serialize() const { - Json::Value node(coolant::Pipe::serialize()); + Json::Value node(Coolant::Pipe::serialize()); node["inserted"] = inserted; node["absorbed"] = absorbed; return node; } -BoronRod::BoronRod(coolant::Vessel* v) : coolant::Pipe(v) +BoronRod::BoronRod(Coolant::Vessel* v) : Coolant::Pipe(v) { } diff --git a/src/reactor/control/boron_rod.hpp b/src/reactor/control/boron_rod.hpp index 7a06729..4f55db2 100644 --- a/src/reactor/control/boron_rod.hpp +++ b/src/reactor/control/boron_rod.hpp @@ -3,10 +3,10 @@ #include "../coolant/pipe.hpp" -namespace Sim::Reactor::control +namespace Sim::Reactor::Control { -class BoronRod : public coolant::Pipe +class BoronRod : public Coolant::Pipe { double inserted = 1; double absorbed = 0; @@ -18,8 +18,8 @@ class BoronRod : public coolant::Pipe public: - BoronRod(coolant::Vessel* v); - BoronRod(const Json::Value& node, coolant::Vessel* v); + BoronRod(Coolant::Vessel* v); + BoronRod(const Json::Value& node, Coolant::Vessel* v); virtual Json::Value serialize() const; virtual void update(double secs); diff --git a/src/reactor/control/graphite_rod.hpp b/src/reactor/control/graphite_rod.hpp index 038c5b1..3c114ea 100644 --- a/src/reactor/control/graphite_rod.hpp +++ b/src/reactor/control/graphite_rod.hpp @@ -3,7 +3,7 @@ #include "../rod.hpp" -namespace Sim::Reactor::control +namespace Sim::Reactor::Control { class GraphiteRod : public Sim::Reactor::Rod diff --git a/src/reactor/coolant/heater.hpp b/src/reactor/coolant/heater.hpp index 8acd287..c7166a3 100644 --- a/src/reactor/coolant/heater.hpp +++ b/src/reactor/coolant/heater.hpp @@ -3,7 +3,7 @@ #include "../rod.hpp" -namespace Sim::Reactor::coolant +namespace Sim::Reactor::Coolant { class Heater : public Sim::Reactor::Rod diff --git a/src/reactor/coolant/pipe.cpp b/src/reactor/coolant/pipe.cpp index 1f2c79f..ec87b40 100644 --- a/src/reactor/coolant/pipe.cpp +++ b/src/reactor/coolant/pipe.cpp @@ -4,13 +4,13 @@ using namespace Sim::Reactor::Coolant; -Pipe::Pipe(coolant::Vessel* v) +Pipe::Pipe(Coolant::Vessel* v) { this->vessel = v; this->steam = 0; } -Pipe::Pipe(const Json::Value& node, coolant::Vessel* v) : vessel(v) +Pipe::Pipe(const Json::Value& node, Coolant::Vessel* v) : vessel(v) { steam = node["steam"].asDouble(); } diff --git a/src/reactor/coolant/pipe.hpp b/src/reactor/coolant/pipe.hpp index 276f8cb..5bb65cf 100644 --- a/src/reactor/coolant/pipe.hpp +++ b/src/reactor/coolant/pipe.hpp @@ -4,14 +4,14 @@ #include "vessel.hpp" #include "../rod.hpp" -namespace Sim::Reactor::coolant +namespace Sim::Reactor::Coolant { class Pipe : public Sim::Reactor::Rod { protected: - coolant::Vessel* vessel; + Coolant::Vessel* vessel; double steam; virtual double get_k(Sim::Reactor::Rod::val_t type) const; @@ -22,8 +22,8 @@ protected: public: - Pipe(coolant::Vessel* v); - Pipe(const Json::Value& node, coolant::Vessel* v); + Pipe(Coolant::Vessel* v); + Pipe(const Json::Value& node, Coolant::Vessel* v); virtual Json::Value serialize() const; virtual std::unique_ptr clone() const { return std::make_unique(*this); } diff --git a/src/reactor/coolant/vessel.cpp b/src/reactor/coolant/vessel.cpp index 43891b5..c690791 100644 --- a/src/reactor/coolant/vessel.cpp +++ b/src/reactor/coolant/vessel.cpp @@ -67,7 +67,7 @@ void Vessel::update(double secs) steam_last = steam; steam_suspended += diff; - steam_suspended *= Reactor::fuel::half_life::get(secs, bubble_hl); + steam_suspended *= Reactor::Fuel::half_life::get(secs, bubble_hl); if(steam_suspended < 0) { diff --git a/src/reactor/coolant/vessel.hpp b/src/reactor/coolant/vessel.hpp index a262953..5f6d024 100644 --- a/src/reactor/coolant/vessel.hpp +++ b/src/reactor/coolant/vessel.hpp @@ -5,7 +5,7 @@ #include "../../coolant/fluid_holder.hpp" -namespace Sim::Reactor::coolant +namespace Sim::Reactor::Coolant { class Vessel : public Sim::Coolant::FluidHolder diff --git a/src/reactor/fuel/fuel_rod.hpp b/src/reactor/fuel/fuel_rod.hpp index 604a3ae..37c92da 100644 --- a/src/reactor/fuel/fuel_rod.hpp +++ b/src/reactor/fuel/fuel_rod.hpp @@ -4,7 +4,7 @@ #include "sample.hpp" #include "../rod.hpp" -namespace Sim::Reactor::fuel +namespace Sim::Reactor::Fuel { class FuelRod : public Sim::Reactor::Rod diff --git a/src/reactor/fuel/half_life.hpp b/src/reactor/fuel/half_life.hpp index daffe5d..f7fbb44 100644 --- a/src/reactor/fuel/half_life.hpp +++ b/src/reactor/fuel/half_life.hpp @@ -3,7 +3,7 @@ #include -namespace Sim::Reactor::fuel::half_life +namespace Sim::Reactor::Fuel::half_life { const double Te_135 = 19; diff --git a/src/reactor/fuel/sample.hpp b/src/reactor/fuel/sample.hpp index 7cdb4d5..377ff54 100644 --- a/src/reactor/fuel/sample.hpp +++ b/src/reactor/fuel/sample.hpp @@ -5,14 +5,14 @@ #include -namespace Sim::Reactor::fuel +namespace Sim::Reactor::Fuel { class Sample { constexpr static const double Xe_135_M = 1e6; - Sim::Reactor::fuel::Waste waste; + Sim::Reactor::Fuel::Waste waste; // mol double fuel = 0; diff --git a/src/reactor/fuel/waste.hpp b/src/reactor/fuel/waste.hpp index 56f3d24..b8a081f 100644 --- a/src/reactor/fuel/waste.hpp +++ b/src/reactor/fuel/waste.hpp @@ -3,7 +3,7 @@ #include -namespace Sim::Reactor::fuel +namespace Sim::Reactor::Fuel { class Waste diff --git a/src/reactor/reactor.cpp b/src/reactor/reactor.cpp index ae2344d..55da515 100644 --- a/src/reactor/reactor.cpp +++ b/src/reactor/reactor.cpp @@ -246,7 +246,7 @@ void Reactor::get_stats(Rod::val_t type, double& min, double& max) } } -Reactor::Reactor(const Json::Value& node, coolant::Vessel* v) : +Reactor::Reactor(const Json::Value& node, Coolant::Vessel* v) : cell_width(node["cell_width"].asDouble()), cell_height(node["cell_height"].asDouble()), width(node["width"].asInt()), diff --git a/src/reactor/reactor.hpp b/src/reactor/reactor.hpp index 0f69389..aaa7726 100644 --- a/src/reactor/reactor.hpp +++ b/src/reactor/reactor.hpp @@ -27,7 +27,7 @@ struct Reactor int cursor; Reactor(std::unique_ptr* rods, int width, int height, double cell_width, double cell_height); - Reactor(const Json::Value& node, coolant::Vessel* v); + Reactor(const Json::Value& node, Coolant::Vessel* v); Reactor(const Reactor& r); Reactor(Reactor&& r); diff --git a/src/system.cpp b/src/system.cpp index 486c616..b84df47 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -38,8 +38,8 @@ System::System() " C C C C " }; - vessel = std::make_unique(Sim::Coolant::WATER, 8, 10, 6e6, 5e5, 10); - reactor = std::make_unique(Sim::Reactor::Builder(19, 19, 1.0 / 4.0, 4, Reactor::fuel::FuelRod(0.2), vessel.get(), layout)); + vessel = std::make_unique(Sim::Coolant::WATER, 8, 10, 6e6, 5e5, 10); + reactor = std::make_unique(Sim::Reactor::Builder(19, 19, 1.0 / 4.0, 4, Reactor::Fuel::FuelRod(0.2), vessel.get(), layout)); condenser = std::make_unique(Sim::Coolant::WATER, 6, 4, 3e6, 30000); turbine = std::make_unique(Sim::Coolant::WATER, condenser.get(), 6, 3, 2e6); @@ -59,7 +59,7 @@ System::System(const Json::Value& node) { clock = node["clock"].asDouble(); - vessel = std::make_unique(node["vessel"]); + vessel = std::make_unique(node["vessel"]); reactor = std::make_unique(node["reactor"], vessel.get()); condenser = std::make_unique(node["condenser"]); turbine = std::make_unique(node["turbine"], condenser.get()); diff --git a/src/system.hpp b/src/system.hpp index 3ff9793..001ebc6 100644 --- a/src/system.hpp +++ b/src/system.hpp @@ -22,7 +22,7 @@ struct System static System active; std::unique_ptr reactor; - std::unique_ptr vessel; + std::unique_ptr vessel; std::unique_ptr sink; std::unique_ptr condenser;