From d7a6270dfed824a4929177eb3efed7203a39c4aa Mon Sep 17 00:00:00 2001 From: codeboss <2422523675@qq.com> Date: Fri, 13 Jun 2025 12:22:26 +0800 Subject: [PATCH] nothing --- ComponentBasic/invisible_component.cpp | 56 ++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 ComponentBasic/invisible_component.cpp diff --git a/ComponentBasic/invisible_component.cpp b/ComponentBasic/invisible_component.cpp new file mode 100644 index 0000000..3fb78f6 --- /dev/null +++ b/ComponentBasic/invisible_component.cpp @@ -0,0 +1,56 @@ +#include "invisible_component.h" + +ComponentsInfoPull::ComponentsInfoPull() {} + +void ComponentsInfoPull::bindEntity(std::weak_ptr ins) +{ + this->_bind_entity = ins; +} + +QString ComponentsInfoPull::name() const +{ + return NAME(ComponentsInfoPull); +} + +#include +#include +void ComponentsInfoPull::execute(std::shared_ptr map, + std::shared_ptr in, QList>& out) +{ + auto rst = std::make_shared(); + rst->reset(in->targetEntity(), in->sourceEntity()); + + auto bind_e = this->_bind_entity.lock(); + rst->_entity_json["entity_templet"] = bind_e->templetName(); + rst->_entity_json["entity_id"] = QJsonValue::fromVariant(QVariant::fromValue(bind_e->entityID())); + rst->_entity_json["entity_name"] = bind_e->name(); + + QList> comp_list; + auto host_conv = std::dynamic_pointer_cast(bind_e); + comp_list = host_conv->components(); + + auto array = QJsonArray(); + for (auto ins : comp_list) { + auto info_comp = QJsonObject(); + info_comp["component_type"] = ins->name(); + ins->saveTo(info_comp); + array.append(info_comp); + } + rst->_entity_json["component_list"] = array; + out << rst; +} + +void ComponentsInfoPull::execute(std::shared_ptr map, + std::shared_ptr in, QList>& out) +{ +dd +} + +std::shared_ptr ComponentsInfoPull::defaultNew() const +{ + return std::make_shared(); +} + +void ComponentsInfoPull::recoveryFrom(const QJsonObject& obj) {} + +void ComponentsInfoPull::saveTo(QJsonObject& obj) const {}