public override Map Generate() {
if( Finished ) return Result;
try {
ReportProgress( 0, "Raising..." );
Raise();
if( Canceled ) return null;
ReportProgress( 20, "Eroding..." );
Erode();
if( Canceled ) return null;
ReportProgress( 35, "Soiling..." );
Soil();
if( Canceled ) return null;
if( genParams.AddCaves ) {
ReportProgress( 45, "Carving..." );
Carve();
if( Canceled ) return null;
}
ReportProgress( 55, "Depositing coal..." );
int density = (int)Math.Round( genParams.OreDensity*CoalOreDensity );
MakeOreVeins( Block.Coal, density );
ReportProgress( 58, "Depositing iron..." );
density = (int)Math.Round( genParams.OreDensity*IronOreDensity );
MakeOreVeins( Block.IronOre, density);
ReportProgress( 61, "Depositing gold..." );
density = (int)Math.Round( genParams.OreDensity*GoldOreDensity );
MakeOreVeins( Block.GoldOre, density );
if( Canceled ) return null;
ReportProgress( 65, "Watering..." );
Water();
if( Canceled ) return null;
ReportProgress( 75, "Melting..." );
Melt();
if( Canceled ) return null;
ReportProgress( 80, "Growing..." );
Grow();
if( Canceled ) return null;
if( genParams.AddFlowers ) {
ReportProgress( 90, "Planting flowers..." );
PlantFlowers();
if( Canceled ) return null;
}
if( genParams.AddMushrooms ) {
ReportProgress( 93, "Planting shrooms..." );
PlantShrooms();
if( Canceled ) return null;
}
if( genParams.AddTrees ) {
ReportProgress( 96, "Planting trees..." );
PlantTrees();
if( Canceled ) return null;
}
Result = map;
return map;
} finally {
ReportProgress( 100, Canceled ? "Canceled" : "Finished" );
Finished = true;
}
}