Work on SoundMacroEditor

This commit is contained in:
Jack Andersen
2018-07-21 17:45:47 -10:00
parent 321c2d9a3c
commit 441a3dbfd9
9 changed files with 700 additions and 66 deletions

View File

@@ -23,6 +23,15 @@ struct MakeCmdOp
}
};
struct MakeDefaultCmdOp
{
template <class Tp, class R>
static std::unique_ptr<SoundMacro::ICmd> Do(R& r)
{
return std::make_unique<Tp>();
}
};
struct IntrospectCmdOp
{
template <class Tp>
@@ -546,8 +555,14 @@ O SoundMacro::CmdDo(_Args&&... args)
}
template std::unique_ptr<SoundMacro::ICmd> SoundMacro::CmdDo<MakeCmdOp>(athena::io::MemoryReader& r);
template std::unique_ptr<SoundMacro::ICmd> SoundMacro::CmdDo<MakeCmdOp>(athena::io::YAMLDocReader& r);
template std::unique_ptr<SoundMacro::ICmd> SoundMacro::CmdDo<MakeDefaultCmdOp>(SoundMacro::CmdOp& r);
template const SoundMacro::CmdIntrospection* SoundMacro::CmdDo<IntrospectCmdOp>(SoundMacro::CmdOp& op);
std::unique_ptr<SoundMacro::ICmd> SoundMacro::MakeCmd(CmdOp op)
{
return CmdDo<MakeDefaultCmdOp, std::unique_ptr<SoundMacro::ICmd>>(op);
}
const SoundMacro::CmdIntrospection* SoundMacro::GetCmdIntrospection(CmdOp op)
{
return CmdDo<IntrospectCmdOp, const SoundMacro::CmdIntrospection*>(op);