fixing small issues to save some resources

This commit is contained in:
Erris 2025-04-20 21:31:53 +02:00
parent b714c6f82d
commit 5077c09d38
3 changed files with 5 additions and 6 deletions

View File

@ -7,7 +7,8 @@ template<typename StateOwnerType>
class StateMachinePool {
public:
void RegisterEntity(const std::string &id, StateOwnerType &entity) {
machines[id] = std::make_unique<StateMachine<StateOwnerType>>(entity, factory);
auto machine = std::make_unique<StateMachine<StateOwnerType>>(entity, factory);
machines[id] = std::move(machine);
}
void UnregisterEntity(const std::string &id) {

View File

@ -13,8 +13,6 @@ using json = nlohmann::json;
template<typename T>
class StateMachine {
using SharedState = std::shared_ptr<State<T>>;
public:
StateMachine(T &owner, const StateFactory<T> &factory) : owner(owner), factory(factory) {};