Ejemplo n.º 1
0
void LmRightSpotScene::onGamecomponentEvent(bytes l_oMsg)
{

	int idGameComponent = l_oMsg.readInt();

	layerChildReceive(idGameComponent);
}
Ejemplo n.º 2
0
void LmRightSpotScene::onGamecomponentWellPlacedEvent(bytes l_oMsg)
{
	int l_iIdGameComponent = l_oMsg.readInt();
	bool l_bWellPlaced = l_oMsg.readBool();

	if (l_bWellPlaced)
	{

		//erase it of the elements that can be touched
		m_aDynamicGameComponents.erase(
				std::remove(m_aDynamicGameComponents.begin(),
						m_aDynamicGameComponents.end(),
						m_aIdTable.find(l_iIdGameComponent)->second),
				m_aDynamicGameComponents.end());

		m_iNumberOfHole--;

		//make disapear this element
		m_aIdTable.find(l_iIdGameComponent)->second->setVisible(false);

		//check win
		if (m_iNumberOfHole == 0)
		{
			win(true);
		}
	}
	else
	{
		//replace this element in the list
		replaceSendingAreaElementToHisOriginalPlace();

		m_pSpriteFail->setVisible(true);
	}

	m_bTouchBeganDisabled = false;

}