本文整理汇总了C++中Zone::getLocationAt方法的典型用法代码示例。如果您正苦于以下问题:C++ Zone::getLocationAt方法的具体用法?C++ Zone::getLocationAt怎么用?C++ Zone::getLocationAt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zone
的用法示例。
在下文中一共展示了Zone::getLocationAt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: parsePlayer
void Start::parsePlayer(YAML::Node n, std::ostream& lerr) {
player->setName(readYAMLStr(n, "Name", "anonymous"));
player->setUnitProto(Unit::getMob(readYAMLStr(n, "Unit", "player"))->proto);
player->setArea(world->getArea(readYAMLStr(n, "Area", "no area specified")));
Zone* zone = world->getZone(readYAMLStr(n, "Zone", "no zone specified"));
player->setZone(zone);
player->getUnit()->pos = readYAMLCoord(n, "Loc", ORIGIN);
zone->getLocationAt(player->getUnit()->pos)->unit = player->getUnit();
}
示例2: findAreaUnits
void Start::findAreaUnits() {
areaUnits.clear();
Area* area = player->getArea();
for (unsigned int i = 0; i < area->getNumZones(); i++) {
Zone* zone = area->getZone(i);
if (zone->isFilled()) {
for (int k = 0; k < zone->getHeight(); k++) {
for (int j = 0; j < zone->getWidth(); j++) {
Location* loc = zone->getLocationAt(Coord(j, k));
if (loc->hasUnit()) {
areaUnits.insert(std::pair<Unit*, Zone*>(loc->unit, zone));
}
}
}
}
}
}