2016-04-25 05:46:28 +00:00
|
|
|
#include "CStateMachine.hpp"
|
|
|
|
#include "CAi.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
|
|
|
CStateMachine::CStateMachine(CInputStream& in)
|
|
|
|
{
|
|
|
|
}
|
2016-05-13 03:13:34 +00:00
|
|
|
|
|
|
|
s32 CStateMachine::GetStateIndex(const std::string& state)
|
|
|
|
{
|
|
|
|
auto it = std::find_if(x0_states.begin(), x0_states.end(), [&state](const CAiState& st) -> bool {
|
|
|
|
return (strncmp(st.GetName(), state.c_str(), 31) == 0);
|
|
|
|
});
|
|
|
|
if (it == x0_states.end())
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
return it - x0_states.begin();
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::vector<CAiState>& CStateMachine::GetStateVector() const
|
|
|
|
{
|
|
|
|
return x0_states;
|
|
|
|
}
|
2016-04-25 05:46:28 +00:00
|
|
|
}
|