mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 22:41:49 +00:00
CommandsInterpreter variables
This commit is contained in:
parent
b38128ef39
commit
88d0553eda
2 changed files with 19 additions and 9 deletions
|
|
@ -87,12 +87,17 @@ namespace cmd {
|
|||
|
||||
class CommandsInterpreter {
|
||||
std::unique_ptr<CommandsRepository> repository;
|
||||
std::unordered_map<std::string, dynamic::Value> variables;
|
||||
public:
|
||||
CommandsInterpreter(std::unique_ptr<CommandsRepository> repository)
|
||||
: repository(std::move(repository)){}
|
||||
|
||||
Prompt parse(std::string_view text);
|
||||
|
||||
dynamic::Value& operator[](const std::string& name) {
|
||||
return variables[name];
|
||||
}
|
||||
|
||||
CommandsRepository* getRepository() const {
|
||||
return repository.get();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue