change folder name

This commit is contained in:
Julian Nießner
2019-06-02 17:54:50 +02:00
parent 84beaf7fd6
commit 473432d9bb
7 changed files with 2 additions and 2 deletions

37
src/commands/Command.cpp Normal file
View File

@@ -0,0 +1,37 @@
#include "Command.h"
#include "../Shared.h"
#include <iostream>
#include <sstream>
Command *Command::create(int clientIndex, yojimbo::Message *message)
{
switch (message->GetType())
{
case (int)GameMessageType::TEST:
return new TestCommand(clientIndex, message);
case (int)GameMessageType::SETNAME:
return new SetNameCommand(clientIndex, message);
default:
std::cout << "Unknown message type received!" << std::endl;
return nullptr;
}
}
Command *Command::create(std::string command)
{
std::stringstream ss(command);
std::string token;
ss >>
token;
if (token == "stop")
{
return new StopCommandInternal();
}
else if (token == "test")
{
return new TestCommandInternal();
}
std::cout << "Internal commando don't exists: " << command << std::endl;
return nullptr;
}