#include "stdafx.h"
#include "2ObjChipMaster.h"	// This header.

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#ifdef SUPER_CLASS
#undef SUPER_CLASS
#endif//SUPER_CLASS
#define SUPER_CLASS MC2ObjGroup

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjChipMaster::MC2ObjChipMaster
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDfCiDjDiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_FDFoundDoc_xZkqqHx_iCmM_xHqqkZx_InStream_xZkqqHx_iCmFjFeLjHhGiBeC_xHqqkZx_
 *			_xZkqqHx_iDiBiDjDiDgPjFmPjAjEiCpAjFmPiNfIiClFiCmEiCkCiCoJiCkKiBeB_xHqqkZx_Doc::AppendToZOrder_xZkqqHx_iCkKiMmEiCnBiPgPiClFiMlD_xHqqkZx_
 *			_xZkqqHx_iCkJiCoHiOmAiNhDiClDiCoKiCoJiCmNiClIiCmIiCmMiCmFiBeB_xHqqkZx_JustDid()_xZkqqHx_iCmNiOmAiNhDiClFiCmIiCkCiBeC_xHqqkZx_
 *************************************************************************/
MC2ObjChipMaster::MC2ObjChipMaster ()
{
	//----- _xZkqqHx_iDiBiDjDiDgPjFmPjAjEiPiJiKpKiJlL_xHqqkZx_ -----
	m_nChipKind = FDCM_COMPOSITE_CHIP;	// _xZkqqHx_jFkBiNiHjFjEjFgJiDgAiDgCiDhGiBeC_xHqqkZx_
	m_dwChipUserId = DWORD(-1);	// _xZkqqHx_iDgAiDgCiDhGiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iBeC_xHqqkZx_
	m_lDutyLinkIndexSz = 0;		// _xZkqqHx_iDiKiDjDiDeOjGpAiKiEjFjEjFgJiCmMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	m_pDutyLinkIndex = NULL;	// _xZkqqHx_iDiKiDjDiDeOjGpAiKiEjFjEjFgJiCmMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	m_lDutyTextIndexSz = 0;		// _xZkqqHx_iDgFiDeMiDfIiDgHjGpAiKiEjFjEjFgJiCmMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
	m_pDutyTextIndex = NULL;	// _xZkqqHx_iDgFiDeMiDfIiDgHjGpAiKiEjFjEjFgJiCmMiDeDiDjDiDgGiDgCiDeOiDfIiBeC_xHqqkZx_
} // MC2ObjChipMaster::MC2ObjChipMaster.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjChipMaster::~MC2ObjChipMaster
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgGiDfIiDgHiDiJiDeOiDfOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.07.11 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
MC2ObjChipMaster::~MC2ObjChipMaster ()
{
	// _xZkqqHx_iKpJjBlGiCmMiDiKiDfIiDgHiCpAiPmBiLiOiBeC_xHqqkZx_
	if (m_pDutyLinkIndex != NULL)
	{
		delete[] m_pDutyLinkIndex;
		m_pDutyLinkIndex = NULL;
	}
	m_lDutyLinkIndexSz = 0;
	// _xZkqqHx_iKpJjBlGiCmMiDiKiDfIiDgHiCpAiPmBiLiOiBeC_xHqqkZx_
	if (m_pDutyTextIndex != NULL)
	{
		delete[] m_pDutyTextIndex;
		m_pDutyTextIndex = NULL;
	}
	m_lDutyTextIndexSz = 0;
} // MC2ObjChipMaster::~MC2ObjChipMaster.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjChipMaster::Type
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iClBiCmMiDeOiDiJiDfIiCmMiMfOiCpAjFnEiClH_xHqqkZx_.
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iDeOiDiJiDfIiCmMiMfO_xHqqkZx_
 *************************************************************************/
FTObjectType MC2ObjChipMaster::Type () const
{
	return FDOJ_CHIP_MASTER;
} // MC2ObjChipMaster::Type.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjChipMaster::OutStreamV3
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCmJiPjBiCkLiPgPiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_iPjBiCkLiPgPiClFjHhAiCmM_xHqqkZx_MCARCHIVE
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. MCARCHIVE_xZkqqHx_iCpA_xHqqkZx_MCARCHIVE_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjChipMaster::OutStreamV3 (MCARCHIVE& ar)
{
	SUPER_CLASS::OutStreamV3(ar);
	//----- _xZkqqHx_iDgAiDgCiDhGiOoNjFmKiCpAjDpMjHmN_xHqqkZx_ -----
	// _xZkqqHx_iDgAiDgCiDhGiOoNjFmKiCpAiPgPjHmNiBeC_xHqqkZx_
	ar << m_nChipKind;
	// _xZkqqHx_iDgAiDgCiDhGiDiGiBfLiDfF_xHqqkZx_ID_xZkqqHx_iCpAiPgPjHmNiBeC_xHqqkZx_
	ar << m_dwChipUserId;
	long lC;
	//----- _xZkqqHx_iDiKiDjDiDeOjGpAiKiEjFjEjFgJiDiKiDfIiDgHiCpAiPgPjHmN_xHqqkZx_ -----
	ar << (short)m_lDutyLinkIndexSz;
	for (lC = 0; lC < m_lDutyLinkIndexSz; lC++)
		ar << m_pDutyLinkIndex[lC];

	//----- _xZkqqHx_iDgFiDeMiDfIiDgHjGpAiKiEjFjEjFgJiDiKiDfIiDgHiCpAiPgPjHmN_xHqqkZx_ -----
	ar << (short)m_lDutyTextIndexSz;
	for (lC = 0; lC < m_lDutyTextIndexSz; lC++)
		ar << m_pDutyTextIndex[lC];
} // MC2ObjChipMaster::OutStreamV3.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjChipMaster::InStreamV12
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_jFjEjFgJiCmMiPpDjBnEiCpAiDfIiDgHiDiKiBfLiDiAiCkJiCoHjDmHiCnNiNjOiCnOiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	ar	: _xZkqqHx_jDmHiCnNiNjOiCnNjHhAiCmM_xHqqkZx_MCARCHIVE
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	99.03.03 Fukushiro M. MCARCHIVE_xZkqqHx_iCpA_xHqqkZx_MCARCHIVE_xZkqqHx_iCmJiPeDjAlDiBeC_xHqqkZx_
 *************************************************************************/
void MC2ObjChipMaster::InStreamV12 (MCARCHIVE& ar)
{
	SUPER_CLASS::InStreamV12(ar);
	short nSize;
	//----- _xZkqqHx_iDiKiDjDiDeOjGpAiKiEjFjEjFgJiDiKiDfIiDgHiCpAjDpMjHmN_xHqqkZx_ -----
	// _xZkqqHx_iKpJjBlGiCmMiDiKiDfIiDgHiCpAiPmBiLiOiBeC_xHqqkZx_
	if (m_pDutyLinkIndex != NULL)
	{
		delete[] m_pDutyLinkIndex;
		m_pDutyLinkIndex = NULL;
	}
	ar >> nSize;
	m_lDutyLinkIndexSz = nSize;
	if (0 < nSize)
	{
		m_pDutyLinkIndex = new short[nSize];
		for (short nC = 0; nC < nSize; nC++)
			ar >> m_pDutyLinkIndex[nC];
	}

	//----- _xZkqqHx_iDgFiDeMiDfIiDgHjGpAiKiEjFjEjFgJiDiKiDfIiDgHiCpAjDpMjHmN_xHqqkZx_ -----
	// _xZkqqHx_iKpJjBlGiCmMiDiKiDfIiDgHiCpAiPmBiLiOiBeC_xHqqkZx_
	if (m_pDutyTextIndex != NULL)
	{
		delete[] m_pDutyTextIndex;
		m_pDutyTextIndex = NULL;
	}
	ar >> nSize;
	m_lDutyTextIndexSz = nSize;
	if (0 < nSize)
	{
		m_pDutyTextIndex = new short[nSize];
		for (short nC = 0; nC < nSize; nC++)
			ar >> m_pDutyTextIndex[nC];
	}
} // MC2ObjChipMaster::InStreamV12.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjChipMaster::GetChipKind
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgAiDgCiDhGiOoNjFmKiCpAjFnEiClHiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jFnEjCgM_xHqqkZx_>	FDCM_OBJECT_CHIP	= 1,	// _xZkqqHx_jDmGjHkHjFjEjFgJiDgAiDgCiDhGiBeC_xHqqkZx_
 *			FDCM_COMPOSITE_CHIP	= 2,	// _xZkqqHx_jFkBiNiHiDgAiDgCiDhGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
short MC2ObjChipMaster::GetChipKind () const
{
	return m_nChipKind;
} // MC2ObjChipMaster::GetChipKind.

/*************************************************************************
 * <_xZkqqHx_iKnGjAjE_xHqqkZx_>	MC2ObjChipMaster::SetChipKind
 *
 * <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iDgAiDgCiDhGiOoNjFmKiCpAjAnNjCoIiClHiCoJiBeC_xHqqkZx_
 *
 * <_xZkqqHx_iIpIjAjE_xHqqkZx_>	nChipKind	:_xZkqqHx_iDgAiDgCiDhGiOoNjFmKiCpAiOhHjCoIiBeC_xHqqkZx_
 *						FDCM_OBJECT_CHIP	= 1,	// _xZkqqHx_jDmGjHkHjFjEjFgJiDgAiDgCiDhGiBeC_xHqqkZx_
 *						FDCM_COMPOSITE_CHIP	= 2,	// _xZkqqHx_jFkBiNiHiDgAiDgCiDhGiBeC_xHqqkZx_
 *
 * <_xZkqqHx_jHjKjHpA_xHqqkZx_>	01.08.13 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
 *************************************************************************/
void MC2ObjChipMaster::SetChipKind (short nChipKind)
{
	m_nChipKind = nChipKind;
} // MC2ObjChipMaster::SetChipKind.
