本文整理汇总了C++中MapObject::GetInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ MapObject::GetInfo方法的具体用法?C++ MapObject::GetInfo怎么用?C++ MapObject::GetInfo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapObject
的用法示例。
在下文中一共展示了MapObject::GetInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetNavigationString
void MapLayer::SetNavigationString(){
float option = 0.0f;
MapObject *obj = (MapObject*)this->getChildByTag(mouseY*width+mouseX);
if(obj)
option = obj->GetInfo().option;
if(isEraser)
navigation->setString(StringUtils::format("<mapEdit>\ncurser : %d\nerase : true\nposition : (%d,%d)\nnumber : %d\noption : %.1f", nowTile, mouseX, mouseY, mapData[mouseY][mouseX], option));
else
navigation->setString(StringUtils::format("<mapEdit>\ncurser : %d\nerase : false\nposition : (%d,%d)\nnumber : %d\noption : %.1f", nowTile, mouseX, mouseY, mapData[mouseY][mouseX], option));
}
示例2: OpenGate
void MapLayer::OpenGate(){
float range = 300;
MapObject *gate = nullptr;
auto jeje = JeJe::GetInstance();
for(MapObject *obstacle : obstacleList){
MapObjectInfo info = obstacle->GetInfo();
if(info.number == 20 && GetDistance(obstacle->getPosition(), jeje->getPosition()) < range){
gate = obstacle;
}
}
if(gate && ((Gate*)gate)->Open(jeje->HasBlue(), jeje->HasPurple(), jeje->HasRed())){
MapObjectInfo info = gate->GetInfo();
auto act1 = MoveBy::create(1.0f, Vec2(0, TILE_SIZE*2));
gate->runAction(act1);
mapData[info.y][info.x] = 0;
mapData[info.y+1][info.x] = 0;
}
}