本文整理汇总了C++中Cell::CellY方法的典型用法代码示例。如果您正苦于以下问题:C++ Cell::CellY方法的具体用法?C++ Cell::CellY怎么用?C++ Cell::CellY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cell
的用法示例。
在下文中一共展示了Cell::CellY方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: AddToGrid
void Map::AddToGrid(Creature* obj, NGridType *grid, Cell const& cell)
{
// add to world object registry in grid
if(obj->isPet())
{
}
// add to grid object store
else
{
(*grid)(cell.CellX(), cell.CellY()).AddGridObject<Creature>(obj, obj->GetGUID());
obj->SetCurrentCell(cell);
}
}
示例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;
}
示例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;
}
示例5: Visit
void ObjectWorldLoader::Visit(CorpseMapType& /*m*/)
{
CellCoord cellCoord = i_cell.GetCellCoord();
if (std::unordered_set<Corpse*> const* corpses = i_map->GetCorpsesInCell(cellCoord.GetId()))
{
for (Corpse* corpse : *corpses)
{
corpse->AddToWorld();
GridType& cell = i_grid.GetGridType(i_cell.CellX(), i_cell.CellY());
if (corpse->IsWorldObject())
cell.AddWorldObject(corpse);
else
cell.AddGridObject(corpse);
++i_corpses;
}
}
}
示例6: RemoveFromGrid
void Map::RemoveFromGrid(T* obj, NGridType *grid, Cell const& cell)
{
(*grid)(cell.CellX(), cell.CellY()).template RemoveGridObject<T>(obj, obj->GetGUID());
}