mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-15 17:27:57 -05:00
Add base for menu eventhandlerset parsing
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
#include "GenericMenuEventHandlerSetPropertySequence.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "Parsing/Menu/Matcher/MenuMatcherFactory.h"
|
||||
|
||||
using namespace menu;
|
||||
|
||||
GenericMenuEventHandlerSetPropertySequence::GenericMenuEventHandlerSetPropertySequence(std::string keywordName, callback_t setCallback)
|
||||
: m_set_callback(std::move(setCallback))
|
||||
{
|
||||
const MenuMatcherFactory create(this);
|
||||
|
||||
AddMatchers({
|
||||
create.KeywordIgnoreCase(std::move(keywordName)),
|
||||
create.Char('{')
|
||||
});
|
||||
}
|
||||
|
||||
void GenericMenuEventHandlerSetPropertySequence::ProcessMatch(MenuFileParserState* state, SequenceResult<SimpleParserValue>& result) const
|
||||
{
|
||||
state->m_current_event_handler_set = std::make_unique<CommonEventHandlerSet>();
|
||||
state->m_event_handler_set_callback = m_set_callback;
|
||||
}
|
Reference in New Issue
Block a user