Exemplo n.º 1
0
//-------------------------------------------------------------------------------------
bool Spaces::destroySpace(SPACE_ID spaceID, ENTITY_ID entityID)
{
    INFO_MSG(fmt::format("Spaces::destroySpace: {}.\n", spaceID));

    Space* pSpace = Spaces::findSpace(spaceID);
    if(pSpace->isDestroyed())
        return true;

    if(!pSpace->destroy(entityID))
    {
        ERROR_MSG("Spaces::destroySpace: is error!\n");
        return false;
    }

    spaces_.erase(spaceID);
    return true;
}
Exemplo n.º 2
0
//-------------------------------------------------------------------------------------
bool Spaces::destroySpace(SPACE_ID spaceID, ENTITY_ID entityID)
{
	INFO_MSG(fmt::format("Spaces::destroySpace: {}.\n", spaceID));

	Space* pSpace = Spaces::findSpace(spaceID);
	if(pSpace->isDestroyed())
		return true;

	if(!pSpace->destroy(entityID))
	{
		//WARNING_MSG("Spaces::destroySpace: destroying!\n");
		return false;
	}

	// 延时一段时间再销毁
	//spaces_.erase(spaceID);
	return true;
}