本文整理汇总了C++中PlayerCityPtr::setBorderInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCityPtr::setBorderInfo方法的具体用法?C++ PlayerCityPtr::setBorderInfo怎么用?C++ PlayerCityPtr::setBorderInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCityPtr
的用法示例。
在下文中一共展示了PlayerCityPtr::setBorderInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TilePos
void C3Sav::Impl::initEntryExit(std::fstream &f, PlayerCityPtr ioCity)
{
unsigned int size = ioCity->tilemap().size();
const unsigned int savePos = f.tellg();
// init road entry/exit point
unsigned short int i = 0;
unsigned short int j = 0;
f.seekg(1236, std::ios::cur);
f.read((char*)&i, 2);
f.read((char*)&j, 2);
BorderInfo borderInfo;
borderInfo.roadEntry = TilePos( i, size - j - 1 );
f.read((char*)&i, 2);
f.read((char*)&j, 2);
borderInfo.roadExit = TilePos( i, size - j - 1 );
// init boat entry/exit point
f.seekg(savePos, std::ios::beg);
f.seekg(1276, std::ios::cur);
f.read((char*)&i, 2);
f.read((char*)&j, 2);
borderInfo.boatEntry = TilePos( i, size - j - 1 );
f.read((char*)&i, 2);
f.read((char*)&j, 2);
borderInfo.boatExit = TilePos( i, size - j - 1);
ioCity->setBorderInfo( borderInfo );
f.seekg(savePos, std::ios::beg);
}
示例2: TilePos
void C3Map::Impl::initEntryExit(std::fstream &f, PlayerCityPtr ioCity)
{
unsigned int size = ioCity->tilemap().size();
// init road entry/exit point
unsigned short int i = 0;
unsigned short int j = 0;
f.seekg(kRoadEntry, std::ios::beg);
f.read((char*)&i, 2);
f.read((char*)&j, 2);
BorderInfo borderInfo;
borderInfo.roadEntry = TilePos( i, size - j - 1 );
f.read((char*)&i, 2);
f.read((char*)&j, 2);
borderInfo.roadExit = TilePos( i, size - j - 1 );
// init boat entry/exit point
f.seekg(kBoatEntry, std::ios::beg);
f.read((char*)&i, 2);
f.read((char*)&j, 2);
borderInfo.boatEntry = TilePos( i, size - j - 1 );
f.read((char*)&i, 2);
f.read((char*)&j, 2);
borderInfo.boatExit = TilePos( i, size - j - 1);
ioCity->setBorderInfo( borderInfo );
//std::cout << "road entry at:" << ioCity.getRoadEntryI() << "," << ioCity.getRoadEntryJ() << std::endl;
//std::cout << "road exit at:" << ioCity.getRoadExitI() << "," << ioCity.getRoadExitJ() << std::endl;
//std::cout << "boat entry at:" << ioCity.getBoatEntryI() << "," << ioCity.getBoatEntryJ() << std::endl;
//std::cout << "boat exit at:" << ioCity.getBoatExitI() << "," << ioCity.getBoatExitJ() << std::endl;
}