本文整理汇总了C++中House::getExit方法的典型用法代码示例。如果您正苦于以下问题:C++ House::getExit方法的具体用法?C++ House::getExit怎么用?C++ House::getExit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类House
的用法示例。
在下文中一共展示了House::getExit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnListBoxDoubleClick
void HousePalettePanel::OnListBoxDoubleClick(wxCommandEvent& event)
{
House* house = reinterpret_cast<House*>(event.GetClientData());
// I find it extremly unlikely that one actually wants the exit at 0,0,0, so just treat it as the null value
if(house && house->getExit() != Position(0,0,0)) {
gui.CenterOnPosition(house->getExit());
}
}
示例2: undo
//.........这里部分代码省略.........
if(oldtile->isSelected())
editor.selection.addInternal(oldtile);
if(newtile->isSelected())
editor.selection.removeInternal(newtile);
if(newtile->getHouseID() != oldtile->getHouseID())
{
// oooooomggzzz we need to remove it from the appropriate house!
House* house = editor.map.houses.getHouse(newtile->getHouseID());
if(house)
{
house->removeTile(newtile);
}
else
{
// Set tile house to 0, house has been removed
newtile->setHouse(nullptr);
}
house = editor.map.houses.getHouse(oldtile->getHouseID());
if(house)
{
house->addTile(oldtile);
}
}
if(oldtile->spawn)
{
if(newtile->spawn)
{
if(*oldtile->spawn != *newtile->spawn)
{
editor.map.removeSpawn(newtile);
editor.map.addSpawn(oldtile);
}
}
else
{
editor.map.addSpawn(oldtile);
}
}
else if(newtile->spawn)
{
editor.map.removeSpawn(newtile);
}
*data = newtile;
// Update client dirty list
if(editor.IsLiveClient() && dirty_list && type != ACTION_REMOTE)
{
// Local action, assemble changes
dirty_list->AddChange(c);
}
} break;
case CHANGE_MOVE_HOUSE_EXIT:
{
std::pair<uint32_t, Position>* p = reinterpret_cast<std::pair<uint32_t, Position>* >(c->data);
ASSERT(p);
House* whathouse = editor.map.houses.getHouse(p->first);
if(whathouse)
{
Position oldpos = whathouse->getExit();
whathouse->setExit(p->second);
p->second = oldpos;
}
} break;
case CHANGE_MOVE_WAYPOINT:
{
std::pair<std::string, Position>* p = reinterpret_cast<std::pair<std::string, Position>* >(c->data);
ASSERT(p);
Waypoint* wp = editor.map.waypoints.getWaypoint(p->first);
if(wp)
{
// Change the tiles
TileLocation* oldtile = editor.map.getTileL(wp->pos);
TileLocation* newtile = editor.map.getTileL(p->second);
// Only need to remove from old if it actually exists
if(p->second != Position())
if(oldtile && oldtile->getWaypointCount() > 0)
oldtile->decreaseWaypointCount();
newtile->increaseWaypointCount();
// Update shit
Position oldpos = wp->pos;
wp->pos = p->second;
p->second = oldpos;
}
} break;
default:
break;
}
++it;
}
editor.selection.finish(Selection::INTERNAL);
commited = false;
}
示例3: commit
//.........这里部分代码省略.........
}
if(oldtile->spawn)
{
if(newtile->spawn)
{
if(*oldtile->spawn != *newtile->spawn)
{
editor.map.removeSpawn(oldtile);
editor.map.addSpawn(newtile);
}
}
else
{
// Spawn has been removed
editor.map.removeSpawn(oldtile);
}
}
else if(newtile->spawn)
{
editor.map.addSpawn(newtile);
}
//oldtile->update();
if(oldtile->isSelected())
editor.selection.removeInternal(oldtile);
*data = oldtile;
}
else
{
*data = editor.map.allocator(location);
if(newtile->getHouseID() != 0)
{
// oooooomggzzz we need to add it to the appropriate house!
House* house = editor.map.houses.getHouse(newtile->getHouseID());
if(house)
{
house->addTile(newtile);
}
}
if(newtile->spawn)
editor.map.addSpawn(newtile);
}
// Mark the tile as modified
newtile->modify();
// Update client dirty list
if(editor.IsLiveClient() && dirty_list && type != ACTION_REMOTE)
{
// Local action, assemble changes
dirty_list->AddChange(c);
}
} break;
case CHANGE_MOVE_HOUSE_EXIT:
{
std::pair<uint32_t, Position>* p = reinterpret_cast<std::pair<uint32_t, Position>* >(c->data);
ASSERT(p);
House* whathouse = editor.map.houses.getHouse(p->first);
if(whathouse)
{
Position oldpos = whathouse->getExit();
whathouse->setExit(p->second);
p->second = oldpos;
}
} break;
case CHANGE_MOVE_WAYPOINT:
{
std::pair<std::string, Position>* p = reinterpret_cast<std::pair<std::string, Position>* >(c->data);
ASSERT(p);
Waypoint* wp = editor.map.waypoints.getWaypoint(p->first);
if(wp) {
// Change the tiles
TileLocation* oldtile = editor.map.getTileL(wp->pos);
TileLocation* newtile = editor.map.getTileL(p->second);
// Only need to remove from old if it actually exists
if(p->second != Position())
if(oldtile && oldtile->getWaypointCount() > 0)
oldtile->decreaseWaypointCount();
newtile->increaseWaypointCount();
// Update shit
Position oldpos = wp->pos;
wp->pos = p->second;
p->second = oldpos;
}
} break;
default:
break;
}
++it;
}
editor.selection.finish(Selection::INTERNAL);
commited = true;
}