mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 22:27:41 +00:00
New code style refactor
This commit is contained in:
@@ -4,56 +4,48 @@
|
||||
#include "DataSpec/DNACommon/DNACommon.hpp"
|
||||
#include "DNAMP1.hpp"
|
||||
|
||||
namespace DataSpec::DNAMP1
|
||||
{
|
||||
struct AFSM : public BigDNA
|
||||
{
|
||||
namespace DataSpec::DNAMP1 {
|
||||
struct AFSM : public BigDNA {
|
||||
AT_DECL_DNA_YAML
|
||||
Value<atUint32> stateCount;
|
||||
Vector<String<-1>, AT_DNA_COUNT(stateCount)> stateNames;
|
||||
Value<atUint32> triggerCount;
|
||||
|
||||
struct State : public BigDNA {
|
||||
AT_DECL_DNA_YAML
|
||||
Value<atUint32> stateCount;
|
||||
Vector<String<-1>, AT_DNA_COUNT(stateCount)> stateNames;
|
||||
Value<atUint32> triggerCount;
|
||||
Value<atUint32> transitionCount;
|
||||
struct Transition : public BigDNA {
|
||||
AT_DECL_EXPLICIT_DNA_YAML
|
||||
Value<atUint32> triggerCount;
|
||||
|
||||
struct State : public BigDNA
|
||||
{
|
||||
AT_DECL_DNA_YAML
|
||||
Value<atUint32> transitionCount;
|
||||
struct Transition : public BigDNA
|
||||
{
|
||||
AT_DECL_EXPLICIT_DNA_YAML
|
||||
Value<atUint32> triggerCount;
|
||||
|
||||
struct Trigger : public BigDNA
|
||||
{
|
||||
AT_DECL_EXPLICIT_DNA_YAML
|
||||
bool first = false;
|
||||
String<-1> name;
|
||||
Value<float> parameter;
|
||||
Value<atUint32> targetState;
|
||||
};
|
||||
Vector<Trigger, AT_DNA_COUNT(triggerCount)> triggers;
|
||||
};
|
||||
Vector<Transition, AT_DNA_COUNT(transitionCount)> transitions;
|
||||
struct Trigger : public BigDNA {
|
||||
AT_DECL_EXPLICIT_DNA_YAML
|
||||
bool first = false;
|
||||
String<-1> name;
|
||||
Value<float> parameter;
|
||||
Value<atUint32> targetState;
|
||||
};
|
||||
Vector<Trigger, AT_DNA_COUNT(triggerCount)> triggers;
|
||||
};
|
||||
Vector<State, AT_DNA_COUNT(stateCount)> states;
|
||||
Vector<Transition, AT_DNA_COUNT(transitionCount)> transitions;
|
||||
};
|
||||
Vector<State, AT_DNA_COUNT(stateCount)> 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 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;
|
||||
}
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user