// DWBS ------------------------------------------------------------------ DWBS
//
// PLATFORM		: ALL
// PRODUCT		: BIT_DEMON
// VISIBILITY	: PUBLIC
//
// DWBS ------------------------------------------------------------------ DWBS

#include "TeamInfo.h"

void PublicTeamInfo::serialize(bdBitBuffer& buffer)
{
	bdTeamInfo::serialize(buffer);
	buffer.writeInt32(m_int1);
	buffer.writeInt32(m_int2);
	buffer.writeInt32(m_int3);
	buffer.writeInt32(m_int4);
	buffer.writeInt32(m_int5);
	buffer.writeInt32(m_int6);

	buffer.writeString(m_string1);
	buffer.writeString(m_string2);
}

bdBool PublicTeamInfo::deserialize(bdBitBufferRef buffer)
{
	bdBool ok = bdTeamInfo::deserialize(buffer);

	ok = ok && buffer->readInt32(m_int1);
	ok = ok && buffer->readInt32(m_int2);
	ok = ok && buffer->readInt32(m_int3);
	ok = ok && buffer->readInt32(m_int4);
	ok = ok && buffer->readInt32(m_int5);
	ok = ok && buffer->readInt32(m_int6);

	ok = ok && buffer->readString(m_string1);
	ok = ok && buffer->readString(m_string2);

	return ok;
}

void PrivateTeamInfo::serialize(bdBitBuffer& buffer)
{
	bdTeamInfo::serialize(buffer);
	buffer.writeString(m_string1);
	buffer.writeString(m_string2);
}

bdBool PrivateTeamInfo::deserialize(bdBitBufferRef buffer)
{
	bdBool ok = bdTeamInfo::deserialize(buffer);
	ok = ok && buffer->readString(m_string1);
	ok = ok && buffer->readString(m_string2);

	return ok;
}

// Team Member Info's

void PublicTeamMemberInfo::serialize(bdBitBuffer& buffer)
{
	bdTeamMemberInfo::serialize(buffer);
	buffer.writeInt64(m_int1);
	buffer.writeInt32(m_int2);
	buffer.writeInt32(m_int3);
	buffer.writeString(m_string1);
	buffer.writeString(m_string2);
}

bdBool PublicTeamMemberInfo::deserialize(bdBitBufferRef buffer)
{
	bdBool ok = bdTeamMemberInfo::deserialize(buffer);
	ok = ok && buffer->readInt64(m_int1);
	ok = ok && buffer->readInt32(m_int2);
	ok = ok && buffer->readInt32(m_int3);
	ok = ok && buffer->readString(m_string1);
	ok = ok && buffer->readString(m_string2);

	return ok;
}

void PrivateTeamMemberInfo::serialize(bdBitBuffer& buffer)
{
	bdTeamMemberInfo::serialize(buffer);
	buffer.writeInt32(m_int1);

	buffer.writeString(m_string1);
	buffer.writeString(m_string2);
}

bdBool PrivateTeamMemberInfo::deserialize(bdBitBufferRef buffer)
{
	bdBool ok = bdTeamMemberInfo::deserialize(buffer);
	ok = ok && buffer->readInt32(m_int1);
	ok = ok && buffer->readString(m_string1);
	ok = ok && buffer->readString(m_string2);

	return ok;
}
