本文整理汇总了C++中map::readMap方法的典型用法代码示例。如果您正苦于以下问题:C++ map::readMap方法的具体用法?C++ map::readMap怎么用?C++ map::readMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类map
的用法示例。
在下文中一共展示了map::readMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadSave
bool loadSave(std::string saveName, map &map1, player &TheOne)
{
std::string saveAddress = "../save/"+saveName+".sav";
ifstream save;
save.open(saveAddress.c_str());
if(save.is_open())
{
int offset = 0;
save>> TheOne.name;
save>> offset;
TheOne.x = offset;
save>> offset;
TheOne.y = offset;
save>> offset;
TheOne.direction = offset;
save>> offset;
TheOne.hp = offset;
save>> offset;
TheOne.mp = offset;
save>> offset;
TheOne.status = offset;
save>> offset;
TheOne.strength = offset;
save>> offset;
TheOne.endurance = offset;
save>> offset;
TheOne.agility = offset;
save>> offset;
TheOne.intelligence = offset;
save>> offset;
TheOne.charisma = offset;
save>> offset;
TheOne.wisdom = offset;
save>> offset;
TheOne.will = offset;
// DOING THIS IN A LOOP WOULD BE FAR MORE ELEGANT.
save.ignore();
save>> map1.name;
if(map1.readMap() && map1.loadStage())
{
}else
{
save.close();
return false;
}
// FINISH THIS YOU ASSHOLE
}else