metaforce/Runtime/World/CAiFuncMap.hpp

25 lines
651 B
C++
Raw Normal View History

2018-10-06 20:42:33 -07:00
#pragma once
2016-04-24 22:46:28 -07:00
#include <string_view>
#include <unordered_map>
2016-04-24 22:46:28 -07:00
2021-04-10 01:42:06 -07:00
namespace metaforce {
class CAi;
class CStateManager;
2018-12-07 21:30:43 -08:00
enum class EStateMsg { Activate = 0, Update = 1, Deactivate = 2 };
2016-04-24 22:46:28 -07:00
using CAiStateFunc = void (CAi::*)(CStateManager&, EStateMsg, float);
using CAiTriggerFunc = bool (CAi::*)(CStateManager&, float);
2016-08-15 13:43:04 -07:00
2018-12-07 21:30:43 -08:00
class CAiFuncMap {
std::unordered_map<std::string_view, CAiStateFunc> x0_stateFuncs;
std::unordered_map<std::string_view, CAiTriggerFunc> x10_triggerFuncs;
2018-12-07 21:30:43 -08:00
2016-04-24 22:46:28 -07:00
public:
2018-12-07 21:30:43 -08:00
CAiFuncMap();
CAiStateFunc GetStateFunc(std::string_view func) const;
CAiTriggerFunc GetTriggerFunc(std::string_view func) const;
2016-04-24 22:46:28 -07:00
};
2021-04-10 01:42:06 -07:00
} // namespace metaforce