const related edits in CustomNetProtocol
Should be none impact besides positive ones
This commit is contained in:
parent
22f9daf0d8
commit
02b467be18
|
@ -40,12 +40,13 @@ CustomNetProtocol::CustomNetProtocol()
|
||||||
{
|
{
|
||||||
this->privateData = new PrivateData();
|
this->privateData = new PrivateData();
|
||||||
}
|
}
|
||||||
CustomNetProtocol::CustomNetProtocol(CustomNetProtocol& o)
|
CustomNetProtocol::CustomNetProtocol(const CustomNetProtocol& o)
|
||||||
{
|
{
|
||||||
this->privateData = new PrivateData();
|
this->privateData = new PrivateData();
|
||||||
this->privateData->attributes = o.privateData->attributes;
|
this->privateData->attributes = o.privateData->attributes;
|
||||||
}
|
}
|
||||||
const CustomNetProtocol& CustomNetProtocol::operator=(CustomNetProtocol& o)
|
|
||||||
|
CustomNetProtocol& CustomNetProtocol::operator=(const CustomNetProtocol& o)
|
||||||
{
|
{
|
||||||
if(this->privateData)
|
if(this->privateData)
|
||||||
{
|
{
|
||||||
|
@ -56,11 +57,29 @@ const CustomNetProtocol& CustomNetProtocol::operator=(CustomNetProtocol& o)
|
||||||
this->privateData->attributes = o.privateData->attributes;
|
this->privateData->attributes = o.privateData->attributes;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
CustomNetProtocol::~CustomNetProtocol()
|
CustomNetProtocol::~CustomNetProtocol()
|
||||||
{
|
{
|
||||||
delete this->privateData;
|
delete this->privateData;
|
||||||
this->privateData = 0;
|
this->privateData = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const NetAttributeContainer& CustomNetProtocol::operator[](int ID) const
|
||||||
|
{
|
||||||
|
//if(!this->privateData) this->privateData = new PrivateData();
|
||||||
|
if((unsigned int)ID >= this->privateData->attributes.Size())
|
||||||
|
{
|
||||||
|
NetAttributeContainer temp;
|
||||||
|
|
||||||
|
temp.type = NetAttributeType_UNKNOWN;
|
||||||
|
memset(&temp.value, 0, sizeof(NetAttributeValue));
|
||||||
|
|
||||||
|
this->privateData->attributes.Push(ID, temp);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this->privateData->attributes[ID];
|
||||||
|
}
|
||||||
|
|
||||||
NetAttributeContainer& CustomNetProtocol::operator[](int ID)
|
NetAttributeContainer& CustomNetProtocol::operator[](int ID)
|
||||||
{
|
{
|
||||||
//if(!this->privateData) this->privateData = new PrivateData();
|
//if(!this->privateData) this->privateData = new PrivateData();
|
||||||
|
|
|
@ -130,10 +130,12 @@ namespace Oyster
|
||||||
public:
|
public:
|
||||||
CustomNetProtocol();
|
CustomNetProtocol();
|
||||||
~CustomNetProtocol();
|
~CustomNetProtocol();
|
||||||
CustomNetProtocol(CustomNetProtocol& o);
|
CustomNetProtocol( const CustomNetProtocol& o);
|
||||||
const CustomNetProtocol& operator=(CustomNetProtocol& o);
|
CustomNetProtocol& operator=(const CustomNetProtocol& o);
|
||||||
|
|
||||||
|
const NetAttributeContainer& operator[](int ID) const;
|
||||||
|
NetAttributeContainer& operator[](int ID);
|
||||||
|
|
||||||
NetAttributeContainer& operator[](int ID);
|
|
||||||
void Set(int id, Oyster::Network::NetAttributeValue val, Oyster::Network::NetAttributeType type);
|
void Set(int id, Oyster::Network::NetAttributeValue val, Oyster::Network::NetAttributeType type);
|
||||||
void Set(int ID, std::string s);
|
void Set(int ID, std::string s);
|
||||||
const NetAttributeContainer& Get(int id);
|
const NetAttributeContainer& Get(int id);
|
||||||
|
|
Loading…
Reference in New Issue