Ejemplo n.º 1
0
T *ResManageHAC<T>::Create(const String &name)
{
#ifdef _DEBUG
    if(!hac_data)
    {
        PutError(L"创建资源时,HAC包还未加载。资源名称:%s",name.wc_str());
        return(NULL);
    }
#endif//

    return(new T(hac_data,name));
}
Ejemplo n.º 2
0
void ResManage<F,T>::Clear(T *obj)		///<资源释放虚拟函数
{
#ifdef _DEBUG
    try
    {
        delete obj;
    }
    catch(...)
    {
        PutError(	L"ResManage::Clear() error! this=%p,obj=%p",this,obj);
    }
#else
    delete obj;
#endif//
}
Ejemplo n.º 3
0
void CDissolveDialog::OnActionEvent(LONG id, void * p, DWORD we)
{
	switch(id)
	{
	case DIS_OKBTN:
		{
			PutError(
				Submit(),
				0);
			break;
		}
	case DIS_CANCELBTN:
		{
			Clear();
			break;
		}
	}
}
Ejemplo n.º 4
0
BOOL CDissolveDialog::FakeMoveIcon(LONG x, LONG y, cIcon* movedIcon)
{
	// 완료된 결과가 있을 경우 초기화시킨다
	{
		CItem* const item = (CItem*)mSourceDialog->GetIconForIdx(
			0);

		if(item->IsLocked())
		{
			Clear();
		}
	}

	CItem* const movedItem = (CItem*)movedIcon;

	if(0 == movedItem)
	{
		return FALSE;
	}
	else if(WT_ITEM != movedItem->GetType())
	{
		return FALSE;
	}
	else if(movedItem->IsLocked())
	{
		return FALSE;
	}
	else if(FALSE == ITEMMGR->IsEqualTableIdxForPos(eItemTable_Inventory, movedItem->GetPosition()))
	{
		CHATMGR->AddMsg(
			CTC_SYSMSG,
			CHATMGR->GetChatMsg(787));
		return FALSE;
	}

	// 기존 아이템이 위치한 장소에 놓았을 경우 교체한다
	const POINT point = {x, y};
	CItem* const item = GetSourceItem(
		point);

	if(0 == item)
	{
		return FALSE;
	}
	else if(0 < item->GetItemIdx())
	{
		RemoveSource(
			item->GetItemBaseInfo(),
			POSTYPE(item->GetData()));
		RemoveResult(
			item->GetItemBaseInfo());
		Clear(
			*item);
	}

	const Error error = IsEnableUpdate(movedItem->GetItemBaseInfo());

	if(ErrorNone != error)
	{
		PutError(
			error,
			movedItem->GetItemIdx());
		return FALSE;
	}

	AddSource(
		movedItem->GetItemBaseInfo(),
		POSTYPE(item->GetData()));
	AddResult(
		movedItem->GetItemBaseInfo());

	mSubmitButton->SetActive(
		TRUE);
	return FALSE;
}
Ejemplo n.º 5
0
// 100625 ONS 분해시 우클릭으로 아이템이동 가능하도록 수정.
void CDissolveDialog::MoveIcon( CItem* movedItem )
{
	// 완료된 결과가 있을 경우 초기화시킨다
	{
		CItem* const item = (CItem*)mSourceDialog->GetIconForIdx(
			0);

		if(item->IsLocked())
		{
			Clear();
		}
	}

	if( 0 == movedItem )
	{
		return;
	}
	else if(WT_ITEM != movedItem->GetType())
	{
		return;
	}
	else if(movedItem->IsLocked())
	{
		return;
	}
	else if(FALSE == ITEMMGR->IsEqualTableIdxForPos(eItemTable_Inventory, movedItem->GetPosition()))
	{
		CHATMGR->AddMsg(
			CTC_SYSMSG,
			CHATMGR->GetChatMsg(787));
		return;
	}

	const Error error = IsEnableUpdate(movedItem->GetItemBaseInfo());
	if(ErrorNone != error)
	{
		PutError(
			error,
			movedItem->GetItemIdx());
		return;
	}

	WORD wEmptyPos = 0;
	for(WORD cellIndex = 0; mSourceDialog->GetCellNum() > cellIndex; ++cellIndex)
	{
		CItem* const item = (CItem*)mSourceDialog->GetIconForIdx(
			cellIndex);

		if(0 == item->GetItemIdx())
		{
			wEmptyPos = cellIndex;
			break;
		}
	}

	AddSource(
		movedItem->GetItemBaseInfo(),
		POSTYPE(wEmptyPos));
	AddResult(
		movedItem->GetItemBaseInfo());

	mSubmitButton->SetActive(
		TRUE);
}