#pragma once #include "evo/biology/cellular_currents.hpp" #include "evo/biology/cellular_deposit_motion.hpp" #include "evo/biology/cellular_tuning.hpp" #include #include #include // Rules 12 (Cellular_Region_Movement_Plan.md, ADR-0177): the liquid region a cellular owner // declares when it upgrades to owner format 10. Taken from the Git tuning file and a seed when // the region opens and persisted with the owner, so replay and restore never read the file. namespace evo::server { struct CellularLiquidRules { biology::CellularCurrentConfig currents{}; // Its area is the owner's area. biology::CellularHandling founder{}; // Per-tick founder handling; costs unused. biology::CellularDepositMotionRules deposits{}; // Thrust energy as a share of the metabolic full-speed movement cost, 1..10,000 per mille. std::uint32_t thrust_cost_per_mille{1'000}; auto operator<=>(const CellularLiquidRules&) const = default; }; // Every field is within the kinematic, current and deposit bounds for `area`. [[nodiscard]] bool cellular_liquid_valid(const CellularLiquidRules& rules, biology::CellularArea area) noexcept; // Rules for a region of `area` from the tuning file and a current seed. [[nodiscard]] CellularLiquidRules cellular_liquid_rules(const biology::CellularTuning& tuning, biology::CellularArea area, std::uint64_t seed); // An organism's handling: its genome's arrangement scaled from the declared founder handling, // with full-output costs from its metabolic budget. [[nodiscard]] std::expected cellular_liquid_handling(const biology::Genome& genome, const biology::MetabolicBudget& budget, const CellularLiquidRules& rules); } // namespace evo::server