Improve CONFIG_WORLD_USE_BODY_THREAD handling

We no longer need to do ugly ifdefs in the constructor for
Mind::Mind because we preprocess the handling for BODY and WORLD
in SmoThreadIds.
This commit is contained in:
2026-02-18 02:05:44 -04:00
parent 687bab53b5
commit ab399cafeb
2 changed files with 17 additions and 15 deletions
+8 -12
View File
@@ -1,3 +1,4 @@
#include <config.h>
#include <iostream>
#include <opts.h>
#include <spinscale/asynchronousContinuation.h>
@@ -23,18 +24,13 @@ Mind::Mind(void)
#ifndef CONFIG_WORLD_USE_BODY_THREAD
, std::make_shared<MindThread>(SmoThreadId::WORLD, *this)
#endif
}),
director(*this, std::static_pointer_cast<sscl::ComponentThread>(componentThreads[0])),
canvas(*this, std::static_pointer_cast<sscl::ComponentThread>(componentThreads[1])),
subconscious(*this, std::static_pointer_cast<sscl::ComponentThread>(componentThreads[2])),
body(*this, std::static_pointer_cast<sscl::ComponentThread>(componentThreads[3])),
world(*this,
#ifndef CONFIG_WORLD_USE_BODY_THREAD
std::static_pointer_cast<sscl::ComponentThread>(componentThreads[4])
#else
std::static_pointer_cast<sscl::ComponentThread>(componentThreads[3])
#endif
)
}
),
director(*this, componentThreads[SmoThreadId::DIRECTOR - 1]),
canvas(*this, componentThreads[SmoThreadId::SIMULATOR - 1]),
subconscious(*this, componentThreads[SmoThreadId::SUBCONSCIOUS - 1]),
body(*this, componentThreads[SmoThreadId::BODY - 1]),
world(*this, componentThreads[SmoThreadId::WORLD - 1])
{
}