Exemplo n.º 1
0
int main() {
	Maze* maze;
	MazeGame game;
	StandardMazeBuilder builder;

	game.CreateMaze(builder);
	maze = builder.GetMaze();
	Room* room = maze->RoomNo(1);
	room->Enter();
	return 0;
}
Exemplo n.º 2
0
int main(int argc, const char * argv[]) {
    MazeGame* game = new MazeGame();
    StandardMazeBuilder builder;
    game->CreateMaze(builder);
    Maze* maze = builder.GetMaze();
    
    cout << "---------------------" << endl;
    
    StandardMazeBuilder builder2;
    game->CreateComplexMaze(builder2);
    Maze* maze2 = builder2.GetMaze();
    return 0;
}
Exemplo n.º 3
0
int main(int argc, char** argv)
{
    Maze* maze;

    MazeGame game;

    StandardMazeBuilder builder;
    CountingMazeBuilder countBuilder;

    game.CreateMaze(builder);

    maze = builder.GetMaze();

    game.CreateMaze(countBuilder);

    cout << "room size in maze : " << maze->RoomSize() << endl;

    int roomNum, doorNum;
    countBuilder.GetCounts(roomNum,doorNum);

    cout << "room Num : " << roomNum << " door Num: "  << doorNum << endl;
}
Exemplo n.º 4
0
int main()
{
	//利用StandardMazeBuilder创建迷宫
	Maze* maze;
	MazeGame game;
    StandardMazeBuilder builder;

	game.CreateMaze(builder);
	maze = builder.GetMaze();

	//利用CountingMazeBuilder对迷宫的部件进行计数
	int rooms, doors;
	CountingMazeBuilder cbuilder;
	game.CreateMaze(cbuilder);
	cbuilder.GetCounts(rooms, doors);

	cout << "The maze has " << rooms << " rooms and " 
		 << doors << " doors" << endl;

	system("pause");
	return 0;
}