Using Command pattern andEntityX
This commit is contained in:
12
src/messages/TestCommand.cpp
Normal file
12
src/messages/TestCommand.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user