コード例 #1
0
ファイル: builder.cpp プロジェクト: muyudou/Maze1
	//构造房间
	virtual void BuildRoom(int n)
	{
        Room *room = new Room(n);
		_currentMaze->AddRoom(room);

		room->SetSide(North, new Wall);
		room->SetSide(South, new Wall);
		room->SetSide(East, new Wall);
		room->SetSide(West, new Wall);
	}
コード例 #2
0
void StandardMazeBuilder::BuildRoom(int n) {
	if (!_currentMaze->RoomNo(n)) {
		Room* room = new Room(n);
		_currentMaze->AddRoom(room);

		room->SetSide(North, new Wall);
		room->SetSide(South, new Wall);
		room->SetSide(East, new Wall);
		room->SetSide(West, new Wall);
	}
}
コード例 #3
0
ファイル: builder.cpp プロジェクト: thuang136/algorithm
 virtual void BuildRoom(int room)
 {
    if(_currentMaze != NULL && (_currentMaze->RoomNo(room) == NULL))
    {
        Room* roomA = new Room(room);
        _currentMaze->AddRoom(roomA);
        roomA->SetSide(North,new Wall);
        roomA->SetSide(South,new Wall);
        roomA->SetSide(East,new Wall);
        roomA->SetSide(West,new Wall);
    }
 }
コード例 #4
0
void StandardMazeBuilder::BuildRoom(int roomNo) 
{
    if (currentMaze->RoomNo(roomNo) == NULL)
    {
        Room* room = new Room(roomNo);
        currentMaze->AddRoom(room);

        room->SetSide(North, new Wall());
        room->SetSide(South, new Wall());
        room->SetSide(East, new Wall());
        room->SetSide(West, new Wall());
    }
}