Exemplo n.º 1
0
Maze* MazeGame::CreateMaze () {
    Maze* aMaze = MakeMaze();
/*
*/
    Room* r1 = MakeRoom(1);
    Room* r2 = MakeRoom(2);
    Door* theDoor = MakeDoor(r1, r2);
/*
*/
    aMaze->AddRoom(r1);
    aMaze->AddRoom(r2);
/*
*/
    r1->SetSide(North, MakeWall());
    r1->SetSide(East, theDoor);
    r1->SetSide(South, MakeWall());
    r1->SetSide(West, MakeWall());
/*
*/
    r2->SetSide(North, MakeWall());
    r2->SetSide(East, MakeWall());
    r2->SetSide(South, MakeWall());
    r2->SetSide(West, theDoor);
/*
*/
    return aMaze;
}
Exemplo n.º 2
0
 Maze* CreateMaze(MazeFactory& factory)
 {
     Maze* pMaze = factory.MakeMaze();
     Room* r1 = factory.MakeRoom(1);
     Room* r2 = factory.MakeRoom(2);
     Door* aDoor = factory.MakeDoor(r1,r2);
     pMaze->AddRoom(r1);
     pMaze->AddRoom(r2);
     retrun pMaze;
 }
Exemplo n.º 3
0
Maze* MazeGame::CreateMaze(MazeFactory& factory) {
    Maze* m = factory.MakeMaze();
    Room* r1 = factory.MakeRoom(1);
    Room* r2 = factory.MakeRoom(2);
    Door* d = factory.MakeDoor(r1, r2);

    m->AddRoom(r1);
    m->AddRoom(r2);

    r1->SetSide(North, factory.MakeWall());
    r1->SetSide(East, d);
    r1->SetSide(South, factory.MakeWall());
    r1->SetSide(West, factory.MakeWall());
    r2->SetSide(North, factory.MakeWall());
    r2->SetSide(East, factory.MakeWall());
    r2->SetSide(South, factory.MakeWall());
    r2->SetSide(West, d);

    return m;
}
Exemplo n.º 4
0
Maze* MazeGame::CreateMaze(MazeFactory& factory) {
    Maze* aMaze = factory.MakeMaze();
    Room* r1 = factory.MakeRoom(1);
    Room* r2 = factory.MakeRoom(2);
    Door* aDoor = factory.MakeDoor(r1, r2);

    aMaze->AddRoom(r1);
    aMaze->AddRoom(r2);

    r1->SetSide(North, factory.MakeWall());
    r1->SetSide(East, aDoor);
    r1->SetSide(South, factory.MakeWall());
    r1->SetSide(West, factory.MakeWall());

    r2->SetSide(North, factory.MakeWall());
    r2->SetSide(East, factory.MakeWall());
    r2->SetSide(South, factory.MakeWall());
    r2->SetSide(West, aDoor);

    return aMaze;
}
Exemplo n.º 5
0
Maze *MazeGame::CreateMaze(MazeFactory &mazeFactory)
{
    Maze *aMaze = mazeFactory.MakeMaze();
    Room *r1 = mazeFactory.MakeRoom(1);
    Room *r2 = mazeFactory.MakeRoom(2);

    Door *door = mazeFactory.MakeDoor(r1, r2);

    r1->SetSide(Room::East, door);
    r1->SetSide(Room::South, mazeFactory.MakeWall());
    r1->SetSide(Room::West, mazeFactory.MakeWall());
    r1->SetSide(Room::North, mazeFactory.MakeWall());

    r2->SetSide(Room::East,  mazeFactory.MakeWall());
    r2->SetSide(Room::South, mazeFactory.MakeWall());
    r2->SetSide(Room::West, door);
    r2->SetSide(Room::North, mazeFactory.MakeWall());

    aMaze->AddRoom(r1);
    aMaze->AddRoom(r2);

    return aMaze;
}
Exemplo n.º 6
0
Maze *MazeGame::CreateMaze()
{
    Maze *aMaze = new Maze();

    Room *r1 = new Room(1);
    Room *r2 = new Room(2);

    Door *door = new Door(r1, r2);

    r1->SetSide(Room::East, door);
    r1->SetSide(Room::South, new Wall());
    r1->SetSide(Room::West, new Wall());
    r1->SetSide(Room::North, new Wall());

    r2->SetSide(Room::East,  new Wall());
    r2->SetSide(Room::South, new Wall());
    r2->SetSide(Room::West, door);
    r2->SetSide(Room::North, new Wall());

    aMaze->AddRoom(r1);
    aMaze->AddRoom(r2);

    return aMaze;
}