mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 09:47:43 +00:00
Lots of ScriptObject and Collision work
This commit is contained in:
@@ -10,7 +10,7 @@ CStateMachine::CStateMachine(CInputStream& in)
|
||||
|
||||
x0_states.reserve(stateCount);
|
||||
|
||||
for (u32 i = 0 ; i<stateCount ; ++i)
|
||||
for (u32 i = 0; i < stateCount; ++i)
|
||||
{
|
||||
std::string name = in.readString(31);
|
||||
CAiStateFunc func = CAi::GetStateFunc(name.c_str());
|
||||
@@ -19,31 +19,30 @@ CStateMachine::CStateMachine(CInputStream& in)
|
||||
|
||||
x10_triggers.reserve(in.readUint32Big());
|
||||
|
||||
for (u32 i = 0 ; i<stateCount ; ++i)
|
||||
for (u32 i = 0; i < stateCount; ++i)
|
||||
{
|
||||
x0_states[i].SetNumTriggers(in.readUint32Big());
|
||||
if (x0_states[i].GetNumTriggers() == 0)
|
||||
continue;
|
||||
for (u32 j = 0 ; j<x0_states[i].GetNumTriggers() ; ++j)
|
||||
for (u32 j = 0; j < x0_states[i].GetNumTriggers(); ++j)
|
||||
x10_triggers.emplace_back();
|
||||
|
||||
for (u32 j = 0 ; j<x0_states[i].GetNumTriggers() ; ++j)
|
||||
for (u32 j = 0; j < x0_states[i].GetNumTriggers(); ++j)
|
||||
{
|
||||
u32 triggerCount = in.readUint32Big();
|
||||
u32 r19 = triggerCount - 1;
|
||||
for (u32 k = 0 ; k<triggerCount ; ++k)
|
||||
for (u32 k = 0; k < triggerCount; ++k)
|
||||
{
|
||||
std::string name = in.readString(31);
|
||||
CAiTriggerFunc func = CAi::GetTrigerFunc(name.c_str());
|
||||
float f31 = in.readFloatBig();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
s32 CStateMachine::GetStateIndex(const std::string& state)
|
||||
s32 CStateMachine::GetStateIndex(const std::string& state) const
|
||||
{
|
||||
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);
|
||||
@@ -54,14 +53,24 @@ s32 CStateMachine::GetStateIndex(const std::string& state)
|
||||
return it - x0_states.begin();
|
||||
}
|
||||
|
||||
const std::vector<CAiState>& CStateMachine::GetStateVector() const
|
||||
const std::vector<CAiState>& CStateMachine::GetStateVector() const { return x0_states; }
|
||||
|
||||
float CStateMachineState::GetTime() const { return 0.f; }
|
||||
|
||||
void CStateMachineState::SetState(CStateManager &, CAi &, s32 idx)
|
||||
{
|
||||
return x0_states;
|
||||
}
|
||||
|
||||
float CStateMachineState::GetTime() const
|
||||
void CStateMachineState::SetState(CStateManager& mgr, CAi& ai, const CStateMachine* machine, const std::string& state)
|
||||
{
|
||||
return 0.f;
|
||||
if (!machine)
|
||||
return;
|
||||
|
||||
if (!x0_machine)
|
||||
x0_machine = machine;
|
||||
|
||||
s32 idx = machine->GetStateIndex(state);
|
||||
SetState(mgr, ai, idx);
|
||||
}
|
||||
|
||||
const std::vector<CAiState>* CStateMachineState::GetStateVector() const
|
||||
@@ -72,18 +81,14 @@ const std::vector<CAiState>* CStateMachineState::GetStateVector() const
|
||||
return &x0_machine->GetStateVector();
|
||||
}
|
||||
|
||||
void CStateMachineState::Setup(const CStateMachine *machine)
|
||||
void CStateMachineState::Setup(const CStateMachine* machine)
|
||||
{
|
||||
x0_machine = machine;
|
||||
x4_state = nullptr;
|
||||
x8_ = 0.f;
|
||||
x8_time = 0.f;
|
||||
xc_ = 0.f;
|
||||
x10_= 0.f;
|
||||
}
|
||||
|
||||
std::string CStateMachineState::GetName() const
|
||||
{
|
||||
return {};
|
||||
x10_ = 0.f;
|
||||
}
|
||||
|
||||
std::string CStateMachineState::GetName() const { return {}; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user