本文整理汇总了C++中Maze::AddRoom方法的典型用法代码示例。如果您正苦于以下问题:C++ Maze::AddRoom方法的具体用法?C++ Maze::AddRoom怎么用?C++ Maze::AddRoom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Maze
的用法示例。
在下文中一共展示了Maze::AddRoom方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateMaze
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;
}
示例2: CreateMaze
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;
}
示例3: CreateMaze
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;
}
示例4: CreateMaze
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;
}
示例5:
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;
}
示例6: Maze
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;
}