Elaztek Developer Hub
Blamite Game Engine - blam!  00453.06.08.26.0624.blamite
The core library for the Blamite Game Engine.
find.hpp
Go to the documentation of this file.
1 #include "../console.h"
2 
3 #include <set>
4 
6 
8 {
15  {
16  public:
18  {
19  name = "find";
20  description = "prints any hs command matching the string passed in";
21  syntax = "find <string>";
22 
24  }
25 
26  BlamResult Execute(std::vector<std::string> args)
27  {
28  if (args.size() == 0)
29  {
30  return BlamResult::Error_Command_WrongArgumentCount;
31  }
32 
33  std::map<std::string, BlamConsoleCommand*>::iterator it;
34  std::map<std::string, BlamConsoleCommand*> commands = Blam::Resources::Console::GetCommandList();
35 
36  for (it = commands.begin(); it != commands.end(); it++)
37  {
38  if (BlamStrings::Utils::String::Contains(it->first, args.at(0), true))
39  {
40  Blam::Logger::LogEventForce(it->first, WSV_NONE);
41  }
42  }
43 
44  return BlamResult::Success_OK;
45  }
46  };
47 }
BlamConsoleCommand::description
std::string description
An optional description of the command. Shown when using the classify command.
Definition: console.h:36
logger.h
BlamConsoleCommand
Class used to represent a console command.
Definition: console.h:33
Blam::Resources::Console::FindCommand::FindCommand
FindCommand()
Definition: find.hpp:17
Blam::Resources::Console::FindCommand
Class for the find command.
Definition: find.hpp:14
BlamConsoleCommand::name
std::string name
The name of the console command.
Definition: console.h:35
Blam::Resources::Console::GetCommandList
BLAM std::map< std::string, BlamConsoleCommand * > GetCommandList()
Retrieves the list of all loaded console commands.
Definition: console.cpp:239
BlamConsoleCommand::syntax
std::string syntax
The syntax information for the command. Shown to the user when using the help command with an argumen...
Definition: console.h:37
BlamConsoleCommand::type
BlamCommandType type
The type of command this is. See #Blam::Resources::Console::BlamCommandType for more information.
Definition: console.h:40
Blam::Logger::LogEventForce
BLAM void LogEventForce(std::string message)
Forcibly logs a message to the log and/or console.
Definition: aliases.cpp:262
Blam::Resources::Console::FindCommand::Execute
BlamResult Execute(std::vector< std::string > args)
Called upon command execution.
Definition: find.hpp:26
Blam::Resources::Console
Namespace for things relating to the debug console.
Definition: abort.hpp:5
BlamCommandType::Builtin
@ Builtin
A command that is hard-coded into the engine.