本文整理汇总了C++中Town::deserialize方法的典型用法代码示例。如果您正苦于以下问题:C++ Town::deserialize方法的具体用法?C++ Town::deserialize怎么用?C++ Town::deserialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Town
的用法示例。
在下文中一共展示了Town::deserialize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createFromNetwork
// -----------------------------------------------------------------
// Name : createFromNetwork
// -----------------------------------------------------------------
void Map::createFromNetwork(NetworkData * pData, LocalClient * pLocalClient)
{
m_iWidth = pData->readLong();
m_iHeight = pData->readLong();
m_pTiles = new MapTile**[m_iWidth];
for (u16 x = 0; x < m_iWidth; x++)
{
m_pTiles[x] = new MapTile*[m_iHeight];
for (u16 y = 0; y < m_iHeight; y++)
{
m_pTiles[x][y] = new MapTile(pData->readLong(), pLocalClient->getPlayerManager()->getGlobalSpellsPtr());
if (pData->readLong() == 1)
m_pTiles[x][y]->m_pSpecialTile = SpecialTile::deserialize(pData, pLocalClient->getDebug());
}
}
int nbTowns = pData->readLong();
for (int i = 0; i < nbTowns; i++)
{
Town * pTown = new Town(CoordsMap(0, 0), this, pLocalClient->getPlayerManager()->getGlobalSpellsPtr());
pTown->deserialize(pData, pLocalClient);
m_pTownsRef->addLast(pTown);
}
int nbTemples = pData->readLong();
for (int i = 0; i < nbTemples; i++)
{
Temple * pTemple = new Temple(CoordsMap(0, 0), this, pLocalClient->getPlayerManager()->getGlobalSpellsPtr());
pTemple->deserialize(pData, pLocalClient);
m_pTemplesRef->addLast(pTemple);
}
m_pPathfinder = new Pathfinder(m_pTiles, m_iWidth, m_iHeight);
}