1
0
Fork 0

Inherit constructors, remove duplication

This commit is contained in:
Tiger Wang 2020-07-19 20:49:29 +01:00
parent e2f15776c7
commit 5dd51e87e5
8 changed files with 19 additions and 84 deletions

View File

@ -305,14 +305,9 @@ namespace Metadata
cProtocol_1_10_0::cProtocol_1_10_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_10_0:
void cProtocol_1_10_0::SendSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch)
{

View File

@ -26,7 +26,7 @@ class cProtocol_1_10_0:
public:
cProtocol_1_10_0(cClientHandle * a_Client, const AString &a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_9_4;
protected:

View File

@ -333,14 +333,8 @@ namespace Metadata_1_11
cProtocol_1_11_0::cProtocol_1_11_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_11_0:
void cProtocol_1_11_0::SendCollectEntity(const cEntity & a_Collected, const cEntity & a_Collector, unsigned a_Count)
{
@ -1185,14 +1179,8 @@ void cProtocol_1_11_0::WriteMobMetadata(cPacketizer & a_Pkt, const cMonster & a_
cProtocol_1_11_1::cProtocol_1_11_1(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_11_1:
cProtocol::Version cProtocol_1_11_1::GetProtocolVersion()
{

View File

@ -28,7 +28,7 @@ class cProtocol_1_11_0:
public:
cProtocol_1_11_0(cClientHandle * a_Client, const AString &a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_10_0;
protected:
@ -62,7 +62,7 @@ class cProtocol_1_11_1:
public:
cProtocol_1_11_1(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_11_0;
protected:

View File

@ -318,14 +318,8 @@ namespace Metadata_1_12
cProtocol_1_12::cProtocol_1_12(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_12:
void cProtocol_1_12::WriteEntityMetadata(cPacketizer & a_Pkt, const cEntity & a_Entity)
{
@ -1118,14 +1112,8 @@ bool cProtocol_1_12::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketTyp
cProtocol_1_12_1::cProtocol_1_12_1(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_12_1:
UInt32 cProtocol_1_12_1::GetPacketID(ePacketType a_Packet)
{
@ -1276,15 +1264,6 @@ bool cProtocol_1_12_1::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketT
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_12_2::
cProtocol_1_12_2::cProtocol_1_12_2(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
cProtocol::Version cProtocol_1_12_2::GetProtocolVersion()
{
return Version::Version_1_12_2;

View File

@ -31,7 +31,7 @@ class cProtocol_1_12:
public:
cProtocol_1_12(cClientHandle * a_Client, const AString &a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_11_1;
protected:
@ -58,7 +58,7 @@ class cProtocol_1_12_1:
public:
cProtocol_1_12_1(cClientHandle * a_Client, const AString &a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_12;
protected:
@ -80,7 +80,7 @@ class cProtocol_1_12_2:
public:
cProtocol_1_12_2(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_12_1;
protected:

View File

@ -2155,15 +2155,6 @@ void cProtocol_1_9_0::WriteEntityProperties(cPacketizer & a_Pkt, const cEntity &
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_9_1:
cProtocol_1_9_1::cProtocol_1_9_1(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
void cProtocol_1_9_1::SendLogin(const cPlayer & a_Player, const cWorld & a_World)
{
// Send the Join Game packet:
@ -2211,15 +2202,6 @@ cProtocol::Version cProtocol_1_9_1::GetProtocolVersion()
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_9_2:
cProtocol_1_9_2::cProtocol_1_9_2(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
cProtocol::Version cProtocol_1_9_2::GetProtocolVersion()
{
return Version::Version_1_9_2;
@ -2232,15 +2214,6 @@ cProtocol::Version cProtocol_1_9_2::GetProtocolVersion()
////////////////////////////////////////////////////////////////////////////////
// cProtocol_1_9_4:
cProtocol_1_9_4::cProtocol_1_9_4(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
Super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
}
void cProtocol_1_9_4::SendUpdateSign(int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4)
{
ASSERT(m_State == 3); // In game mode?

View File

@ -155,7 +155,7 @@ class cProtocol_1_9_1:
public:
cProtocol_1_9_1(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_9_0;
protected:
@ -177,7 +177,7 @@ class cProtocol_1_9_2:
public:
cProtocol_1_9_2(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_9_1;
protected:
@ -197,7 +197,7 @@ class cProtocol_1_9_4:
public:
cProtocol_1_9_4(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
using Super::cProtocol_1_9_2;
protected: