本文整理汇总了C++中LinkGraphJob::Graph方法的典型用法代码示例。如果您正苦于以下问题:C++ LinkGraphJob::Graph方法的具体用法?C++ LinkGraphJob::Graph怎么用?C++ LinkGraphJob::Graph使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinkGraphJob
的用法示例。
在下文中一共展示了LinkGraphJob::Graph方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Load_LGRJ
/**
* Load all link graph jobs.
*/
static void Load_LGRJ()
{
int index;
while ((index = SlIterateArray()) != -1) {
if (!LinkGraphJob::CanAllocateItem()) {
/* Impossible as they have been present in previous game. */
NOT_REACHED();
}
LinkGraphJob *lgj = new (index) LinkGraphJob();
SlObject(lgj, GetLinkGraphJobDesc());
LinkGraph &lg = const_cast<LinkGraph &>(lgj->Graph());
SlObject(&lg, GetLinkGraphDesc());
lg.Init(_num_nodes);
SaveLoad_LinkGraph(lg);
}
}
示例2: AfterLoadLinkGraphs
/**
* Spawn the threads for running link graph calculations.
* Has to be done after loading as the cargo classes might have changed.
*/
void AfterLoadLinkGraphs()
{
if (IsSavegameVersionBefore(191)) {
LinkGraph *lg;
FOR_ALL_LINK_GRAPHS(lg) {
for (NodeID node_id = 0; node_id < lg->Size(); ++node_id) {
(*lg)[node_id].UpdateLocation(Station::Get((*lg)[node_id].Station())->xy);
}
}
LinkGraphJob *lgj;
FOR_ALL_LINK_GRAPH_JOBS(lgj) {
lg = &(const_cast<LinkGraph &>(lgj->Graph()));
for (NodeID node_id = 0; node_id < lg->Size(); ++node_id) {
(*lg)[node_id].UpdateLocation(Station::Get((*lg)[node_id].Station())->xy);
}
}
}