Danbias/Code/Game/GameProtocols/PlayerProtocols.h

56 lines
1.5 KiB
C
Raw Normal View History

2013-12-12 09:33:59 +01:00
//////////////////////////////////////////////////////////
// Created 2013 //
// Dennis Andersen, Linda Andersson //
//////////////////////////////////////////////////////////
2013-12-09 11:57:34 +01:00
#ifndef GAMELOGIC_PLAYER_PROTOCOLS_H
#define GAMELOGIC_PLAYER_PROTOCOLS_H
2013-12-12 09:33:59 +01:00
#include <CustomNetProtocol.h>
2013-12-09 11:57:34 +01:00
#include "ProtocolIdentificationID.h"
namespace GameLogic
{
struct Protocol_PlayerMovement :public Network::CustomProtocolObject
{
int ProtocolID;
bool bForward;
bool bBackward;
bool bTurnLeft;
bool bTurnRight;
bool bStrafeRight;
bool bStrafeLeft;
Protocol_PlayerMovement()
{
2013-12-12 09:33:59 +01:00
this->protocol[0].value = ProtocolID = protocol_PlayerNavigation;
this->protocol[0].type = Network::NetAttributeType_Int;
this->protocol[1].type = Network::NetAttributeType_Bool;
this->protocol[2].type = Network::NetAttributeType_Bool;
this->protocol[3].type = Network::NetAttributeType_Bool;
this->protocol[4].type = Network::NetAttributeType_Bool;
this->protocol[5].type = Network::NetAttributeType_Bool;
this->protocol[6].type = Network::NetAttributeType_Bool;
2013-12-09 11:57:34 +01:00
}
Network::CustomNetProtocol* GetProtocol() override
{
2013-12-12 09:33:59 +01:00
this->protocol[1].value = bForward;
this->protocol[2].value = bBackward;
this->protocol[3].value = bTurnLeft;
this->protocol[4].value = bTurnRight;
this->protocol[5].value = bStrafeRight;
this->protocol[6].value = bStrafeRight;
2013-12-09 11:57:34 +01:00
return &protocol;
}
private:
Network::CustomNetProtocol protocol;
};
}
#endif // !GAMELOGIC_PLAYER_PROTOCOLS_H