Big refactor, shuffling a lot of files around

This commit is contained in:
2025-11-01 19:51:19 -04:00
parent 99b7d9f49d
commit 62cd94ca78
125 changed files with 4073 additions and 3011 deletions

38
src/anm2/null.cpp Normal file
View File

@@ -0,0 +1,38 @@
#include "null.h"
#include "xml_.h"
using namespace anm2ed::util;
using namespace tinyxml2;
namespace anm2ed::anm2
{
Null::Null(XMLElement* element, int& id)
{
if (!element) return;
element->QueryIntAttribute("Id", &id);
xml::query_string_attribute(element, "Name", &name);
element->QueryBoolAttribute("ShowRect", &isShowRect);
}
XMLElement* Null::to_element(XMLDocument& document, int id)
{
auto element = document.NewElement("Null");
element->SetAttribute("Id", id);
element->SetAttribute("Name", name.c_str());
if (isShowRect) element->SetAttribute("ShowRect", isShowRect);
return element;
}
void Null::serialize(XMLDocument& document, XMLElement* parent, int id)
{
parent->InsertEndChild(to_element(document, id));
}
std::string Null::to_string(int id)
{
XMLDocument document{};
document.InsertEndChild(to_element(document, id));
return xml::document_to_string(document);
}
}