#pragma once #include #include #include #include #include "KingSystem/Resource/resResource.h" #include "KingSystem/Utils/ParamIO.h" namespace ksys::res { class RagdollBlendWeight : public ParamIO, public Resource { SEAD_RTTI_OVERRIDE(RagdollBlendWeight, Resource) public: struct InputWeight { agl::utl::Parameter rigid_name; agl::utl::Parameter blend_rate; agl::utl::ParameterObj obj; }; struct State { agl::utl::ParameterList list; agl::utl::Parameter state_key; agl::utl::Parameter system_key; agl::utl::ParameterObj setting_obj; agl::utl::ParameterList input_weight_list; sead::Buffer input_weights; }; RagdollBlendWeight() : ParamIO("rgbw", 0) {} ~RagdollBlendWeight() override { mStates.freeBuffer(); } const sead::Buffer& getStates() const { return mStates; } const sead::SafeString& getWeightRigidName(int state_idx, int weight_idx) const; float getWeightBlendRate(int state_idx, int weight_idx) const; int findStateIdx(const sead::SafeString& key) const; bool ParamIO_m0(char* data) override { return true; } void doCreate_(u8* buffer, u32 buffer_size, sead::Heap* heap) override; bool needsParse() const override { return true; } bool parse_(u8* data, size_t size, sead::Heap* heap) override; private: sead::Buffer mStates; }; } // namespace ksys::res