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


C++ NGridType类代码示例

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


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

示例1:

void
IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32) const
{
    m.ResetGridExpiry(grid);
    grid.SetGridState(GRID_STATE_REMOVAL);
    sLog.outDebug("Grid[%u, %u] on map %u moved to REMOVAL state", grid.getX(), grid.getY(), m.GetId());
}
开发者ID:Zaffy,项目名称:OregonCore,代码行数:7,代码来源:GridStates.cpp

示例2: EnsureGridCreated

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

示例3:

void
IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const uint32 &y, const uint32 &) const
{
    m.ResetGridExpiry(grid);
    grid.SetGridState(GRID_STATE_REMOVAL);
    DEBUG_LOG("Grid[%u,%u] on map %u moved to IDLE state", x, y, m.GetId());
}
开发者ID:Sandstorm-Walker,项目名称:MaNGOSZero,代码行数:7,代码来源:GridStates.cpp

示例4:

void
IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32 &x, const uint32 &y, const uint32 &) const
{
    m.ResetGridExpiry(grid);
    grid.SetGridState(GRID_STATE_REMOVAL);
    sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to REMOVAL state", x, y, m.GetId());
}
开发者ID:Ekmek,项目名称:Antiker,代码行数:7,代码来源:GridStates.cpp

示例5: Update

void ActiveState::Update(Map &m, NGridType &grid, GridInfo & info,
        const uint32 &x, const uint32 &y, const uint32 &t_diff) const {
    // Only check grid activity every (grid_expiry/10) ms, because it's really useless to do it every cycle
    info.UpdateTimeTracker(t_diff);
    if (info.getTimeTracker().Passed()) {
        if (grid.ActiveObjectsInGrid() == 0 && !m.ActiveObjectsNearGrid(x, y)) {
            ObjectGridStoper stoper(grid);
            stoper.StopN();
            grid.SetGridState(GRID_STATE_IDLE);
            sLog->outDebug(LOG_FILTER_MAPS,
                    "Grid[%u, %u] on map %u moved to IDLE state", x, y,
                    m.GetId());
        } else {
            m.ResetGridExpiry(grid, 0.1f);
        }
    }
}
开发者ID:BlueSellafield,项目名称:ArkCORE,代码行数:17,代码来源:GridStates.cpp

示例6: Update

void ActiveState::Update(Map& map, NGridType& grid, GridInfo&  info, uint32 diff) const
{
    // Only check grid activity every (grid_expiry/10) ms, because it's really useless to do it every cycle
    info.UpdateTimeTracker(diff);
    if (info.getTimeTracker().Passed())
    {
        if (!grid.GetWorldObjectCountInNGrid<Player>() && !map.ActiveObjectsNearGrid(grid))
        {
            ObjectGridStoper worker;
            TypeContainerVisitor<ObjectGridStoper, GridTypeMapContainer> visitor(worker);
            grid.VisitAllGrids(visitor);
            grid.SetGridState(GRID_STATE_IDLE);
            TC_LOG_DEBUG("maps", "Grid[%u, %u] on map %u moved to IDLE state", grid.getX(), grid.getY(), map.GetId());
        }
        else
            map.ResetGridExpiry(grid, 0.1f);
    }
}
开发者ID:Allowed,项目名称:SkyFire_5xx,代码行数:18,代码来源:GridStates.cpp

示例7: Update

void Map::Update(const uint32 &t_diff)
{
	return;
	for (GridRefManager<NGridType>::iterator i = GridRefManager<NGridType>::begin(); i != GridRefManager<NGridType>::end(); )
	{
		NGridType *grid = i->getSource();
		GridInfo *info = i->getSource()->getGridInfoRef();
		++i; // The update might delete the map and we need the next map before the iterator gets invalid
		assert(grid->GetGridState() >= 0 && grid->GetGridState() < MAX_GRID_STATE);
		si_GridStates[grid->GetGridState()]->Update(*this, *grid, *info, grid->getX(), grid->getY(), t_diff);
	}
}
开发者ID:PyroSamurai,项目名称:legacy-project,代码行数:12,代码来源:Map.cpp

示例8: Update

void RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 t_diff) const
{
    if (!info.getUnloadLock())
    {
        info.UpdateTimeTracker(t_diff);
        if (info.getTimeTracker().Passed())
        {
            if (!m.UnloadGrid(grid, false))
            {
                sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] for map %u differed unloading due to players or active objects nearby", grid.getX(), grid.getY(), m.GetId());
                m.ResetGridExpiry(grid);
            }
        }
    }
}
开发者ID:JunkyBulgaria,项目名称:avalon_core_v1,代码行数:15,代码来源:GridStates.cpp


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