| 154 | // cPOCPieceGenerator: |
| 155 | |
| 156 | cPOCPieceGenerator::cPOCPieceGenerator(int a_Seed) : |
| 157 | m_Seed(a_Seed) |
| 158 | { |
| 159 | // Prepare a vector of available pieces: |
| 160 | m_AvailPieces.push_back(new cPOCPiece(5, 3)); |
| 161 | m_AvailPieces.push_back(new cPOCPiece(7, 5)); |
| 162 | m_AvailPieces.push_back(new cPOCPiece(9, 5)); |
| 163 | m_AvailPieces.push_back(new cPOCPiece(5, 7)); |
| 164 | |
| 165 | // Generate the structure: |
| 166 | cBFSPieceGenerator Gen(*this, a_Seed); |
| 167 | Gen.PlacePieces(0, 50, 0, 6, m_Pieces); |
| 168 | |
| 169 | // DebugPieces(m_Pieces); |
| 170 | |
| 171 | // Get the smallest cuboid encompassing the entire generated structure: |
| 172 | cCuboid Bounds(0, 50, 0, 0, 50, 0); |
| 173 | for (cPlacedPieces::const_iterator itr = m_Pieces.begin(), end = m_Pieces.end(); itr != end; ++itr) |
| 174 | { |
| 175 | Vector3i MinCoords = (*itr)->GetCoords(); |
| 176 | Bounds.Engulf(MinCoords); |
| 177 | Bounds.Engulf(MinCoords + (*itr)->GetPiece().GetSize()); |
| 178 | } // for itr - m_Pieces[] |
| 179 | m_Bounds = Bounds; |
| 180 | } |
| 181 | |
| 182 | |
| 183 |
nothing calls this directly
no test coverage detected