fixing small issues to save some resources
This commit is contained in:
parent
b714c6f82d
commit
5077c09d38
@ -7,7 +7,8 @@ template<typename StateOwnerType>
|
|||||||
class StateMachinePool {
|
class StateMachinePool {
|
||||||
public:
|
public:
|
||||||
void RegisterEntity(const std::string &id, StateOwnerType &entity) {
|
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) {
|
void UnregisterEntity(const std::string &id) {
|
||||||
|
|||||||
@ -13,8 +13,6 @@ using json = nlohmann::json;
|
|||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
class StateMachine {
|
class StateMachine {
|
||||||
using SharedState = std::shared_ptr<State<T>>;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
StateMachine(T &owner, const StateFactory<T> &factory) : owner(owner), factory(factory) {};
|
StateMachine(T &owner, const StateFactory<T> &factory) : owner(owner), factory(factory) {};
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user