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

View File

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

View File

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