mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-07-01 08:41:52 +00:00
Parse game and block commands
This commit is contained in:
@ -17,7 +17,7 @@
|
||||
#include "Parsing/Commands/Sequence/SequenceUse.h"
|
||||
|
||||
CommandsParser::CommandsParser(CommandsLexer* lexer, IDataRepository* targetRepository)
|
||||
: AbstractParser(lexer, std::make_unique<CommandsParserState>()),
|
||||
: AbstractParser(lexer, std::make_unique<CommandsParserState>(targetRepository)),
|
||||
m_repository(targetRepository)
|
||||
{
|
||||
}
|
||||
|
@ -0,0 +1,42 @@
|
||||
#include "CommandsParserState.h"
|
||||
|
||||
CommandsParserState::CommandsParserState(IDataRepository* repository)
|
||||
: m_repository(repository),
|
||||
m_in_use(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
const IDataRepository* CommandsParserState::GetRepository() const
|
||||
{
|
||||
return m_repository;
|
||||
}
|
||||
|
||||
void CommandsParserState::AddBlock(std::unique_ptr<FastFileBlock> block) const
|
||||
{
|
||||
m_repository->Add(std::move(block));
|
||||
}
|
||||
|
||||
void CommandsParserState::SetGame(std::string gameName) const
|
||||
{
|
||||
m_repository->SetGame(std::move(gameName));
|
||||
}
|
||||
|
||||
StructureInformation* CommandsParserState::GetInUse() const
|
||||
{
|
||||
return m_in_use;
|
||||
}
|
||||
|
||||
void CommandsParserState::SetInUse(StructureInformation* structure)
|
||||
{
|
||||
m_in_use = structure;
|
||||
}
|
||||
|
||||
bool CommandsParserState::GetMembersFromParts(const std::string& typeNameValue, StructureInformation* baseType, std::vector<MemberInformation*>& members)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CommandsParserState::GetTypenameAndMembersFromParts(const std::string& typeNameValue, StructureInformation*& structure, std::vector<MemberInformation*>& members)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -1,6 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "Utils/ClassUtils.h"
|
||||
#include "Persistence/IDataRepository.h"
|
||||
|
||||
class CommandsParserState
|
||||
{
|
||||
IDataRepository* m_repository;
|
||||
StructureInformation* m_in_use;
|
||||
|
||||
public:
|
||||
};
|
||||
explicit CommandsParserState(IDataRepository* repository);
|
||||
|
||||
_NODISCARD const IDataRepository* GetRepository() const;
|
||||
|
||||
void AddBlock(std::unique_ptr<FastFileBlock> block) const;
|
||||
void SetGame(std::string gameName) const;
|
||||
|
||||
_NODISCARD StructureInformation* GetInUse() const;
|
||||
void SetInUse(StructureInformation* structure);
|
||||
|
||||
bool GetMembersFromParts(const std::string& typeNameValue, StructureInformation* baseType, std::vector<MemberInformation*>& members);
|
||||
bool GetTypenameAndMembersFromParts(const std::string& typeNameValue, StructureInformation*& structure, std::vector<MemberInformation*>& members);
|
||||
};
|
||||
|
Reference in New Issue
Block a user