1
0
cuberite-2a/src/Generating/PieceStructuresGen.h
peterbell10 13144a08e4
Enable some more clang-tidy linter checks (#4738)
* Avoid inefficient AString -> c_str() -> AString round trip

* Avoid redundant string init expressions

* Avoid unnecessary return, continue, etc.

* Add .clang-format to help with clang-tidy fix-its

* Avoid unnecessary passing by value

* Avoid unnecessary local copying

* Avoid copying in range-for loops

* Avoid over-complicated boolean expressions

* Some violations missed by my local clang-tidy

* Allow unnecessary continue statements

* Add brackets

* Another expression missed locally

* Move BindingsProcessor call into clang-tidy.sh and add space

* Fix pushd not found error

* Different grouping of CheckBlockInteractionRate
2020-05-14 22:15:35 +00:00

61 lines
1.4 KiB
C++

// PieceStructuresGen.h
// Declares the cPieceStructuresGen class representing the PieceStructures finisher generator
/*
This generator loads various pieces from "piecepool" files, and each such piecepool is then used in a separate
cPieceGenerator instance.
*/
#pragma once
#include "ComposableGenerator.h"
#include "PrefabPiecePool.h"
class cPieceStructuresGen:
public cFinishGen
{
using Super = cFinishGen;
public:
cPieceStructuresGen(int a_Seed);
/** Initializes the generator based on the specified prefab sets.
a_Prefabs contains the list of prefab sets that should be activated, "|"-separated.
All problems are logged to the console and the generator skips over them.
Returns true if at least one prefab set is valid (the generator should be kept). */
bool Initialize(const AString & a_Prefabs, int a_SeaLevel, const cBiomeGenPtr & a_BiomeGen, const cTerrainHeightGenPtr & a_HeightGen);
// cFinishGen override:
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
protected:
/** The generator doing the work for a single prefab set.
Forward-declared so that its implementation changes don't affect the header. */
class cGen;
typedef std::shared_ptr<cGen> cGenPtr;
typedef std::vector<cGenPtr> cGenPtrs;
/** The individual structure generators, one per piecepool. */
cGenPtrs m_Gens;
/** The seed for the random number generator */
int m_Seed;
};