本文整理汇总了C#中fCraft.Map.MakeFloodBarrier方法的典型用法代码示例。如果您正苦于以下问题:C# Map.MakeFloodBarrier方法的具体用法?C# Map.MakeFloodBarrier怎么用?C# Map.MakeFloodBarrier使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fCraft.Map
的用法示例。
在下文中一共展示了Map.MakeFloodBarrier方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoGenerate
internal static void DoGenerate( Map map, Player player, string mode, string filename, Random rand, bool hollow )
{
switch( mode ) {
case "flatgrass":
player.Message( "Generating flatgrass map..." );
GenerateFlatgrass( map, hollow );
if( map.Save( filename ) ) {
player.Message( "Map generation: Done." );
} else {
player.Message( Color.Red, "An error occured while generating the map." );
}
break;
case "lag":
player.Message( "Generating laggy map..." );
for( int x = 0; x < map.widthX; x+=2 ) {
for( int y = 0; y < map.widthY; y+=2 ) {
for( int h = 0; h < map.widthY; h+=2 ) {
map.SetBlock( x, y, h, Block.Lava );
}
}
}
if( map.Save( filename ) ) {
player.Message( "Map generation: Done." );
} else {
player.Message( Color.Red, "An error occured while generating the map." );
}
break;
case "empty":
player.Message( "Generating empty map..." );
map.MakeFloodBarrier();
if( map.Save( filename ) ) {
player.Message( "Map generation: Done." );
} else {
player.Message( Color.Red, "An error occured while generating the map." );
}
break;
case "hills":
player.Message( "Generating terrain..." );
Tasks.Add( MapGenerator.GenerationTask, new MapGenerator( rand, map, player, filename,
1, 1, 0.5, 0.5, 0, 0.5, hollow ), false );
break;
case "mountains":
player.Message( "Generating terrain..." );
Tasks.Add( MapGenerator.GenerationTask, new MapGenerator( rand, map, player, filename,
4, 1, 0.5, 0.5, 0.1, 0.5, hollow ), false );
break;
case "lake":
player.Message( "Generating terrain..." );
Tasks.Add( MapGenerator.GenerationTask, new MapGenerator( rand, map, player, filename,
1, 0.6, 0.9, 0.5, -0.35, 0.55, hollow ), false );
break;
case "island":
player.Message( "Generating terrain..." );
Tasks.Add( MapGenerator.GenerationTask, new MapGenerator( rand, map, player, filename,
1, 0.6, 1, 0.5, 0.3, 0.35, hollow ), false );
break;
default:
player.Message( "Unknown map generation mode: " + mode );
break;
}
}
示例2: GenerateFlatgrass
internal static void GenerateFlatgrass( Map map, bool hollow )
{
for ( int i = 0; i < map.widthX; i++ ) {
for ( int j = 0; j < map.widthY; j++ ) {
if ( !hollow ) {
for ( int k = 1; k < map.height / 2 - 1; k++ ) {
if ( k < map.height / 2 - 5 ) {
map.SetBlock( i, j, k, Block.Stone );
} else {
map.SetBlock( i, j, k, Block.Dirt );
}
}
}
map.SetBlock( i, j, map.height / 2 - 1, Block.Grass );
}
}
map.MakeFloodBarrier();
}