当前位置: 首页>>代码示例>>C++>>正文


C++ Cell::GridY方法代码示例

本文整理汇总了C++中Cell::GridY方法的典型用法代码示例。如果您正苦于以下问题:C++ Cell::GridY方法的具体用法?C++ Cell::GridY怎么用?C++ Cell::GridY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cell的用法示例。


在下文中一共展示了Cell::GridY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: loader

void
Map::EnsureGridLoadedForPlayer(const Cell &cell, Player *player, bool add_player)
{
	EnsureGridCreated(GridPair(cell.GridX(), cell.GridY()));
	NGridType *grid = getNGrid(cell.GridX(), cell.GridY());

	assert(grid != NULL);
	if( !isGridObjectDataLoaded(cell.GridX(), cell.GridY()) )
	{
		if( player != NULL )
		{
			player->SendDelayResponse(MAX_GRID_LOAD_TIME);
			DEBUG_LOG("Player %s enter cell[%u,%u] triggers of loading grid[%u,%u] on map %u", player->GetName(), cell.CellX(), cell.CellY(), cell.GridX(), cell.GridY(), i_id);
		}
		else
		{
			DEBUG_LOG("Player nearby triggers of loading grid [%u,%u] on map %u", cell.GridX(), cell.GridY(), i_id);
		}

		ObjectGridLoader loader(*grid, this, cell);
		loader.LoadN();
		setGridObjectDataLoaded(true, cell.GridX(), cell.GridY());

		ResetGridExpiry(*getNGrid(cell.GridX(), cell.GridY()), 0.1f);
		grid->SetGridState(GRID_STATE_ACTIVE);

		if( add_player && player != NULL )
			(*grid)(cell.CellX(), cell.CellY()).AddWorldObject(player, player->GetAccountId());
	}
	else if( player && add_player )
		AddToGrid(player, grid, cell);
}
开发者ID:PyroSamurai,项目名称:legacy-project,代码行数:32,代码来源:Map.cpp

示例2: cell_pair

void
ObjectWorldLoader::Visit(CorpseMapType& m)
{
    uint32 x = (i_cell.GridX() * MAX_NUMBER_OF_CELLS) + i_cell.CellX();
    uint32 y = (i_cell.GridY() * MAX_NUMBER_OF_CELLS) + i_cell.CellY();
    CellPair cell_pair(x, y);
    uint32 cell_id = (cell_pair.y_coord * TOTAL_NUMBER_OF_CELLS_PER_MAP) + cell_pair.x_coord;

    // corpses are always added to spawn mode 0 and they are spawned by their instance id
    CellObjectGuids const& cell_guids = sObjectMgr.GetCellObjectGuids(i_map->GetId(), 0, cell_id);
    GridType& grid = (*i_map->getNGrid(i_cell.GridX(), i_cell.GridY()))(i_cell.CellX(), i_cell.CellY());
    LoadHelper(cell_guids.corpses, cell_pair, m, i_corpses, i_map, grid);
}
开发者ID:Davuk,项目名称:mangos-cata,代码行数:13,代码来源:ObjectGridLoader.cpp

示例3: HandleGPSCommand

bool ChatHandler::HandleGPSCommand(const char* args)
{
    Object *obj = getSelectedUnit();

    if(!obj)
    {
        SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
        return true;
    }

    CellPair cell_val = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
    Cell cell = RedZone::GetZone(cell_val);

    PSendSysMultilineMessage(LANG_MAP_POSITION,
        obj->GetMapId(), obj->GetZoneId(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(),
        obj->GetOrientation(),cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY());

    sLog.outDebug("Player %s GPS call unit " I64FMT " " LANG_MAP_POSITION, m_session->GetPlayer()->GetName(), obj->GetGUID(),
        obj->GetMapId(), obj->GetZoneId(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(),
        obj->GetOrientation(), cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY());

    return true;
}
开发者ID:Artea,项目名称:mangos-svn,代码行数:23,代码来源:Level1.cpp

示例4: HandleGPSCommand

bool ChatHandler::HandleGPSCommand(const char* args)
{
    WorldObject *obj = getSelectedUnit();

    if(!obj)
    {
        SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE);
        return true;
    }

    CellPair cell_val = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
    Cell cell = RedZone::GetZone(cell_val);

    PSendSysMultilineMessage(LANG_MAP_POSITION,
        obj->GetMapId(), obj->GetZoneId(), obj->GetAreaId(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(),
        obj->GetOrientation(),cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(),obj->GetInstanceId());

    sLog.outDebug("Player %s GPS call %s %u " LANG_MAP_POSITION, m_session->GetPlayer()->GetName(),
        (obj->GetTypeId() == TYPEID_PLAYER ? "player" : "creature"), obj->GetGUIDLow(),
        obj->GetMapId(), obj->GetZoneId(), obj->GetAreaId(), obj->GetPositionX(), obj->GetPositionY(), obj->GetPositionZ(),
        obj->GetOrientation(), cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(),obj->GetInstanceId());

    return true;
}
开发者ID:Artea,项目名称:mangos-svn,代码行数:24,代码来源:Level1.cpp


注:本文中的Cell::GridY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。