2022-10-06 21:32:20 +08:00
|
|
|
#include "UserData.h"
|
2020-10-18 00:27:23 +08:00
|
|
|
|
|
|
|
DRAGONBONES_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
void UserData::_onClear()
|
|
|
|
{
|
|
|
|
ints.clear();
|
|
|
|
floats.clear();
|
|
|
|
strings.clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void UserData::addInt(int value)
|
|
|
|
{
|
|
|
|
ints.push_back(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void UserData::addFloat(float value)
|
|
|
|
{
|
|
|
|
floats.push_back(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void UserData::addString(std::string value)
|
|
|
|
{
|
|
|
|
strings.push_back(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
int UserData::getInt(unsigned index) const
|
|
|
|
{
|
|
|
|
return index < ints.size() ? ints[index] : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
float UserData::getFloat(unsigned index) const
|
|
|
|
{
|
|
|
|
return index < floats.size() ? floats[index] : 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string UserData::getString(unsigned index) const
|
|
|
|
{
|
2022-10-06 21:32:20 +08:00
|
|
|
return index < strings.size() ? strings[index] : std::string{};
|
2020-10-18 00:27:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void ActionData::_onClear()
|
|
|
|
{
|
2021-12-25 10:04:45 +08:00
|
|
|
if (data != nullptr)
|
2020-10-18 00:27:23 +08:00
|
|
|
{
|
|
|
|
data->returnToPool();
|
|
|
|
}
|
|
|
|
|
|
|
|
type = ActionType::Play;
|
|
|
|
name = "";
|
|
|
|
bone = nullptr;
|
|
|
|
slot = nullptr;
|
|
|
|
data = nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
DRAGONBONES_NAMESPACE_END
|