Using Command pattern andEntityX

This commit is contained in:
Julian Nießner
2019-06-02 12:57:53 +02:00
parent e024ef3f0c
commit e43d142f6a
10 changed files with 298 additions and 120 deletions

View File

@@ -0,0 +1,12 @@
#include "Command.h"
#include "../core/Components.h"
void TestCommand::execute(GameServer *server)
{
// ... process test message ...
entityx::Entity entity = server->serverToEntityX.at(m_clientIndex);
entityx::ComponentHandle<NetworkPlayerProperties> playerproperties = entity.component<NetworkPlayerProperties>();
std::cout << "Test message received from client " << playerproperties->name << ":" << m_clientIndex << " with data: " << m_message->m_data << std::endl;
}