当前位置: 首页>>代码示例>>C++>>正文


C++ Maze::AddRoom方法代码示例

本文整理汇总了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;
}
开发者ID:ircc,项目名称:test-code-backup,代码行数:27,代码来源:factorymeth.cpp

示例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;
 }
开发者ID:fiskercui,项目名称:testcommon,代码行数:10,代码来源:AbsFactory.cpp

示例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;
}
开发者ID:waterinet,项目名称:miscellaneous_repo,代码行数:20,代码来源:MazeGame.cpp

示例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;
}
开发者ID:sunsuri,项目名称:Design-Patterns-GoF,代码行数:21,代码来源:MazeGame.cpp

示例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;
}
开发者ID:e5MaxSpace,项目名称:DesignPatterns,代码行数:23,代码来源:mazegame.cpp

示例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;
}
开发者ID:e5MaxSpace,项目名称:DesignPatterns,代码行数:24,代码来源:mazegame.cpp


注:本文中的Maze::AddRoom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。