#include "stdafx.h"
// 01.06.12 Fukushiro M. 1_xZkqqHx_iNhDiNoNiPjM_xHqqkZx_ ()
//#include "2MolipConvert.h"
#include "2ZOrder.h"

void MC2ZOrder::Begin (MC2ZOrderIterator& i) const
{
	i.pvvObj = &m_vvZOrder;
	for (i.iV2 = m_vvZOrder.begin(); i.iV2 != m_vvZOrder.end(); i.iV2++)
	{
		if (!(*i.iV2)->empty())
		{
			i.iV1 = (*i.iV2)->begin();
			break;
		}
	}
} // MC2ZOrder::Begin.

void MC2ZOrder::Rbegin (MC2ZOrderReverseIterator& i) const
{
	i.pvvObj = &m_vvZOrder;
	for (i.iV2 = m_vvZOrder.rbegin(); i.iV2 != m_vvZOrder.rend(); i.iV2++)
	{
		if (!(*i.iV2)->empty())
		{
			i.iV1 = (*i.iV2)->rbegin();
			break;
		}
	}
} // MC2ZOrder::Rbegin.

BOOL MC2ZOrder::IsEmpty () const
{
	ConstMC2ObjBaseVPV::const_iterator	iV2;
	for (iV2 = m_vvZOrder.begin(); iV2 != m_vvZOrder.end(); iV2++)
	{
		if (!(*iV2)->empty()) return FALSE;
	}
	return TRUE;
} // MC2ZOrder::IsEmpty.

DWORD MC2ZOrder::Size () const
{
	DWORD dwCount = 0;
	ConstMC2ObjBaseVPV::const_iterator	iV2;
	for (iV2 = m_vvZOrder.begin(); iV2 != m_vvZOrder.end(); iV2++)
	{
		dwCount += (DWORD)(*iV2)->size();
	}
	return dwCount;
} // MC2ZOrder::Size.

MC2ObjBase* MC2ZOrder::Front () const
{
	ConstMC2ObjBaseVPV::const_iterator	iV2;
	for (iV2 = m_vvZOrder.begin(); iV2 != m_vvZOrder.end(); iV2++)
	{
		if (!(*iV2)->empty()) return (*iV2)->front();
	}
	return NULL;
} // MC2ZOrder::Front.

void MC2ZOrder::GetAllOrder (MC2ObjBaseVector& vObj) const
{
	ConstMC2ObjBaseVPV::const_iterator iV2;
	for (iV2 = m_vvZOrder.begin(); iV2 != m_vvZOrder.end(); iV2++)
	{
		vObj.insert(vObj.end(), (*iV2)->begin(), (*iV2)->end());
	}
} // MC2ZOrder::GetAllOrder.

void MC2ZOrder::PushBack (const MC2ObjBaseVector* vObj)
{
	m_vvZOrder.push_back(vObj);
} // MC2ZOrder::PushBack.
