예제 #1
0
	void Program::addCommand(shared_ptr<Command> command)
	{
		m_command_map.insert(CommandPair(command->getName(), command));
		for (auto alias: command->getAliases()){
			m_command_map.insert(CommandPair(alias, command));
		}
	}
void C_Console::registerCommand(const C_HashedString& cmdID, CommandPtr cmdImp) {
	CommandList::const_iterator iter;
	// make sure its not in there first
	for(iter = d_commandList.begin(); iter != d_commandList.end(); ++iter) {
		if(iter->name.getHashValue() == cmdID.getHashValue())
			return;
    }

	d_commandList.push_back(CommandPair(C_HashedString(cmdID), cmdImp)); 
}
예제 #3
0
파일: Command.cpp 프로젝트: madcad/i2c
 void Command::addCommand(std::string command, CommandBase* instance)
 {
     m_commands.insert(CommandPair(command, instance));
 }