From 0ac316ada473dbe1b347c32950d09ddb61f44c4b Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Thu, 27 Nov 2025 01:30:21 +0000 Subject: [PATCH] Define the general state of the sim (extract from main.cpp) --- src/state.hpp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/state.hpp diff --git a/src/state.hpp b/src/state.hpp new file mode 100644 index 0000000..7850659 --- /dev/null +++ b/src/state.hpp @@ -0,0 +1,54 @@ +/* state.hpp: General state of the simulation + * Created: 2025-11-27 + * Author: Aryadev Chavali + * License: See end of file + * Commentary: + */ + +#ifndef STATE_HPP +#define STATE_HPP + +#include + +#include "base.hpp" +#include "node.hpp" + +namespace cw::state +{ + struct State + { + cw::node::NodeAllocator allocator; + std::queue queue; + + State(void); + }; + + struct DrawState + { + const State &state; + struct Bounds + { + cw::node::Node leftmost, rightmost; + f64 lower_val, upper_val; + } bounds; + + DrawState(const State &); + + void compute_bounds(void); + }; +} // namespace cw::state + +#endif + +/* Copyright (C) 2025 Aryadev Chavali + + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License Version 2 for + * details. + + * You may distribute and modify this code under the terms of the GNU General + * Public License Version 2, which you should have received a copy of along with + * this program. If not, please go to . + + */