enum type naming fixed continued.

This commit is contained in:
Sam Mario Svensson 2013-11-28 08:51:21 +01:00
parent 0feb4dff7e
commit a59cd54688
3 changed files with 10 additions and 10 deletions

View File

@ -27,7 +27,7 @@ namespace Oyster
int packageType;
int clientID;
ProtocolHeader() { this->packageType = package_type_header; }
ProtocolHeader() { this->packageType = PackageType_header; }
virtual ~ProtocolHeader() { }
};
@ -37,7 +37,7 @@ namespace Oyster
unsigned int numOfFloats;
float *f;
ProtocolTest() { this->packageType = package_type_test; }
ProtocolTest() { this->packageType = PackageType_test; }
virtual ~ProtocolTest() { delete[] f; }
};
@ -56,13 +56,13 @@ namespace Oyster
{
switch(type)
{
case package_type_header:
case PackageType_header:
if(Protocol.pHeader)
{
delete Protocol.pHeader;
}
break;
case package_type_test:
case PackageType_test:
if(Protocol.pTest)
{
delete Protocol.pTest;

View File

@ -10,11 +10,11 @@ void Translator::Pack( ProtocolHeader &header, OysterByte& bytes )
switch(header.packageType)
{
case package_type_header:
case PackageType_header:
message = new MessageHeader();
break;
case package_type_test:
case PackageType_test:
message = new MessageTest();
break;
}
@ -41,13 +41,13 @@ ProtocolSet* Translator::Unpack(ProtocolSet* set, OysterByte& bytes )
set->type = (PackageType)header->packageType;
switch(set->type)
{
case package_type_header:
case PackageType_header:
message = new MessageHeader();
set->Protocol.pHeader = new ProtocolHeader;
message->Unpack(bytes, *set->Protocol.pHeader);
break;
case package_type_test:
case PackageType_test:
message = new MessageTest();
set->Protocol.pTest = new ProtocolTest;
message->Unpack(bytes, *set->Protocol.pTest);

View File

@ -73,9 +73,9 @@ void chat(Client &client)
switch(set->type)
{
case package_type_header:
case PackageType_header:
break;
case package_type_test:
case PackageType_test:
cout <<"Client 2: " << set->Protocol.pTest->textMessage <<endl;
for(int i = 0; i < set->Protocol.pTest->numOfFloats; i++)
{