DYTSrouce/src/entities/ChaffBombsComponent.cpp

60 lines
1.3 KiB
C++
Raw Normal View History

2025-01-04 04:12:51 +00:00
#include "entities/ChaffBombsComponent.h"
#include "common/SpdLogger.h"
#include "utils/StringUtils.h"
#include "effects/ChaffBombs.h"
ChaffBombsComponent::ChaffBombsComponent(SceneComponent* parent)
: SceneComponent(parent) {
}
ChaffBombsComponent::~ChaffBombsComponent() {
}
std::string ChaffBombsComponent::GetTypeName() {
return "ChaffBombsComponent";
}
bool ChaffBombsComponent::SetAttribute(const char* name, const char* value) {
return SceneComponent::SetAttribute(name, value);
}
bool ChaffBombsComponent::SaveAttribute(tinyxml2::XMLElement* element) {
/* element->SetAttribute("color", StringUtils::Vec4ToString(GetBaseColor()).c_str());
element->SetAttribute("radius", std::to_string(GetRadius()).c_str());
element->SetAttribute("height", std::to_string(GetHeght()).c_str());*/
return SceneComponent::SaveAttribute(element);
}
void ChaffBombsComponent::Begin() {
}
void ChaffBombsComponent::Update(double dt) {
}
void ChaffBombsComponent::AddToRender() {
Initialize();
SceneComponent::AddToRender();
}
void ChaffBombsComponent::Initialize() {
if (initialize_) {
LOG_INFO("initialize_ is true");
return;
}
initialize_ = true;
ChaffBombs* chaffBombs = new ChaffBombs;
mt_ = new osg::MatrixTransform;
mt_->addChild(chaffBombs);
}