本文整理汇总了C++中Door::barred_from方法的典型用法代码示例。如果您正苦于以下问题:C++ Door::barred_from方法的具体用法?C++ Door::barred_from怎么用?C++ Door::barred_from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Door
的用法示例。
在下文中一共展示了Door::barred_from方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: unbar_door
//Room linkages / auto-shift: case 2 (new room has no door, adjacent one does)
//Unbarring a door from the other side
void Tests::unbar_door(){
start_test(__func__);
go("north", 20, 20); //room 1
Door* d = add_door("east");
d->barred = true;
d->barredSide = false;
//make sure door is barred from the other side
assert(d->barred);
assert(d->barred_from(g->cur_room) == false);
// g->cur_room = first_room;
go("south");
go("east", 20, 20); //room 2
go("north", 20, 20); //room 3: should connect to room 1 (going west)
//make sure door is barred from this side
assert(g->cur_room->get_door_on_wall("west")->barred);
assert(g->cur_room->get_door_on_wall("west")->barred_from(g->cur_room));
//go through it
g->run();
//make sure bar was removed
assert(!g->cur_room->get_door_on_wall("east")->barred);
end_test(__func__);
}