From be8c5f0f7fd2a2607ce8bf5ae60830a4d45f8e74 Mon Sep 17 00:00:00 2001 From: John Fultz Date: Mon, 11 Mar 2019 09:29:35 -0500 Subject: Rework the simulation messaging. Break out things that are effectively constant into a separate struct so we don't have to keep initializing them. Also, ensure that all of the things I forgot are abstracted so I can break out the per-move simulation into a different function. --- sim.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'sim.h') diff --git a/sim.h b/sim.h index ee03b4a..0b3a7fb 100644 --- a/sim.h +++ b/sim.h @@ -172,10 +172,11 @@ inline void SimmedMove::setIncludeInSimulation(bool includeInSimulation) typedef vector SimmedMoveList; -struct SimmedMoveMessage +class SimmedMoveMessage { +public: long id; - Game game; + Move move; LevelList levels; vector score; vector bingos; @@ -185,10 +186,21 @@ struct SimmedMoveMessage bool bogowin; std::ostringstream logStream; - bool isLogging; UVString xmlIndent; }; +class SimmedMoveConstants +{ +public: + Game game; + int startPlayerId; + int playerCount; + int decimalTurns; + int levelCount; + bool ignoreOppos; + bool isLogging; +}; + class Simulator { public: @@ -266,7 +278,7 @@ public: // Incoporate the results of a single simulation into the // cumulative results - void incorporateMessage(const struct SimmedMoveMessage &message); + void incorporateMessage(const SimmedMoveMessage &message); // Set oppo's rack to some partially-known tiles. // Set this to an empty rack if no tiles are known, so -- cgit v1.2.3