#pragma once #include #include "DataSpec/DNACommon/DNACommon.hpp" #include "DNAMP1.hpp" namespace DataSpec::DNAMP1 { struct AFSM : public BigDNA { AT_DECL_DNA_YAML Value stateCount; Vector, AT_DNA_COUNT(stateCount)> stateNames; Value triggerCount; struct State : public BigDNA { AT_DECL_DNA_YAML Value transitionCount; struct Transition : public BigDNA { AT_DECL_EXPLICIT_DNA_YAML Value triggerCount; struct Trigger : public BigDNA { AT_DECL_EXPLICIT_DNA_YAML bool first = false; String<-1> name; Value parameter; Value targetState; }; Vector triggers; }; Vector transitions; }; Vector states; static bool Extract(PAKEntryReadStream& rs, const hecl::ProjectPath& outPath) { AFSM afsm; afsm.read(rs); athena::io::FileWriter writer(outPath.getAbsolutePath()); athena::io::ToYAMLStream(afsm, writer); return true; } static bool Cook(const hecl::ProjectPath& inPath, const hecl::ProjectPath& outPath) { AFSM afsm; athena::io::FileReader reader(inPath.getAbsolutePath()); athena::io::FromYAMLStream(afsm, reader); athena::io::FileWriter ws(outPath.getAbsolutePath()); afsm.write(ws); return true; } }; } // namespace DataSpec::DNAMP1