2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-25 05:46:28 +00:00
|
|
|
|
2020-05-08 20:33:29 +00:00
|
|
|
#include <string_view>
|
2017-10-25 07:47:49 +00:00
|
|
|
#include <unordered_map>
|
2016-04-25 05:46:28 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2019-09-08 22:00:55 +00:00
|
|
|
class CAi;
|
|
|
|
class CStateManager;
|
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
enum class EStateMsg { Activate = 0, Update = 1, Deactivate = 2 };
|
2016-04-25 05:46:28 +00:00
|
|
|
|
2019-09-08 22:00:55 +00:00
|
|
|
using CAiStateFunc = void (CAi::*)(CStateManager&, EStateMsg, float);
|
|
|
|
using CAiTriggerFunc = bool (CAi::*)(CStateManager&, float);
|
2016-08-15 20:43:04 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CAiFuncMap {
|
2020-05-08 20:33:29 +00:00
|
|
|
std::unordered_map<std::string_view, CAiStateFunc> x0_stateFuncs;
|
|
|
|
std::unordered_map<std::string_view, CAiTriggerFunc> x10_triggerFuncs;
|
2018-12-08 05:30:43 +00:00
|
|
|
|
2016-04-25 05:46:28 +00:00
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CAiFuncMap();
|
2020-05-08 20:33:29 +00:00
|
|
|
CAiStateFunc GetStateFunc(std::string_view func) const;
|
|
|
|
CAiTriggerFunc GetTriggerFunc(std::string_view func) const;
|
2016-04-25 05:46:28 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|