本文整理汇总了C++中PlayerCityPtr::setClimate方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCityPtr::setClimate方法的具体用法?C++ PlayerCityPtr::setClimate怎么用?C++ PlayerCityPtr::setClimate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCityPtr
的用法示例。
在下文中一共展示了PlayerCityPtr::setClimate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PKWareInputStream
//.........这里部分代码省略.........
if (length <= 0)
f.seekg(1200, std::ios::cur);
else
f.seekg(length, std::ios::cur);
SkipCompressed(f);
SkipCompressed(f);
// 3x int
f.read((char*)&tmp, 4);
f.read((char*)&tmp, 4);
f.read((char*)&tmp, 4);
SkipCompressed(f);
f.seekg(70, std::ios::cur);
SkipCompressed(f); // skip building list
f.seekg(208, std::ios::cur);
SkipCompressed(f); // skip unknown
f.seekg(788, std::ios::cur); // skip unused data
f.read((char*)&tmp, 4); //mapsize
int size = tmp;
PlayerCityPtr oCity = game.city();
Tilemap& oTilemap = oCity->tilemap();
oCity->resize(size);
oCity->setCameraPos( TilePos( 0, 0 ) );
initEntryExit( f, game.city() );
f.seekg(1312, std::ios::cur);
char climate;
f.read(&climate, 1);
oCity->setClimate((ClimateType)climate);
// here goes the WORK!
// loads the graphics map
int border_size = (162 - size) / 2;
std::map< int, std::map< int, unsigned char > > edgeData;
game.city()->setCameraPos( TilePos( size/2, size/2 ) );
for (int itA = 0; itA < size; ++itA)
{
for (int itB = 0; itB < size; ++itB)
{
int i = itB;
int j = size - itA - 1;
int index = 162 * (border_size + itA) + border_size + itB;
Tile& tile = oTilemap.at(i, j);
unsigned int imgId = graphicGrid[index];
Picture pic = imgid::toPicture( imgId );
if( pic.isValid() )
{
tile.setPicture( pic );
tile.setOriginalImgId( imgId );
}
else
{