Beispiel #1
0
//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__);
}